Microsoft-identity-web: Domain hint only specified when login hint is not null or blank

Created on 7 Aug 2020  路  5Comments  路  Source: AzureAD/microsoft-identity-web

Which version of Microsoft Identity Web are you using?
0.2.1-preview

Where is the issue?

  • Web app

    • [x] Sign-in users
    • [ ] Sign-in users and call web APIs
  • Web API

    • [ ] Protected web APIs (validating tokens)
    • [ ] Protected web APIs (validating scopes)
    • [ ] Protected web APIs call downstream web APIs
  • Token cache serialization

    • [ ] In-memory caches
    • [ ] Session caches
    • [ ] Distributed caches
  • Other (please describe)

Repro
Create new net core app
Add identity web auth
Define AzureAd properties in config file with domain property defined but no login hint

Runt the Web app and Web API

Expected behavior
Domain hint to be added to the authorization request even if login hint isn't specified

Actual behavior
domain hint doesn't get added to the authorization call

Possible solution
Move domain hint definition outside the if clause


Hi,

I was working with this package to get a web app running with Azure AD, but found that defining the domain did not add it into my authentication request thus not directly opening the federation login page.

I found that this was because domain_hint is only being added when login_hint is not blank or null.
Is this a bug? I was under the assumption that domain_hint could be provided without a login_hint.

https://github.com/AzureAD/microsoft-identity-web/blob/bd0c266b0d6f42b84dab3cfb9fb1bc830097658b/src/Microsoft.Identity.Web/WebAppExtensions/WebAppAuthenticationBuilderExtensions.cs#L135-L146

P1 bug fixed good first issue

Most helpful comment

I stumbled upon the same issue and it was a great time-saver that @glasody found it before me.
I pushed a PR-suggestion.

Regards,

All 5 comments

Hi @glasody. Thanks for reporting. We also appreciate outside contributions, if you'd like to submit a PR.

I stumbled upon the same issue and it was a great time-saver that @glasody found it before me.
I pushed a PR-suggestion.

Regards,

Included in 0.3.0-preview release.

Thank you for the heads-up. Works as expected 馃憤

Thanks for the update, @durandt !

Was this page helpful?
0 / 5 - 0 ratings