Skip to content

AddSignIn should be more robust to authority having or not a trailing slash.Β #19

Closed

Description

WebApiAuthenticationBuilderExtensions.EnsureAuthorityIsV2_0 was extracted from the WebApiAuthenticationBuilderExtensions.AddProtectedWebAPi method so that we can unit test it. I think it should stay there as this method takes a JwtBearerOptions parameter and It's unit tested.

It provides a more robust processing of authorities accepting them to end in / or not.

We want to do somthing similar for WebAppAuthenticationBuilderExtensions.AddSignIn( this AuthenticationBuilder builder, Action<OpenIdConnectOptions> configureOpenIdConnectOptions, Action<MicrosoftIdentityOptions> configureMicrosoftIdentityOptions, string openIdConnectScheme = OpenIdConnectDefaults.AuthenticationScheme, string cookieScheme = CookieAuthenticationDefaults.AuthenticationScheme, bool subscribeToOpenIdConnectMiddlewareDiagnosticsEvents = false), but with a method enabling an OpenIdConnectOptions.

Activity

  1. self-assigned this
    on Apr 16, 2020
  2. jennyf19 commented on Apr 22, 2020

    @jennyf19
    Collaborator
  3. wowfood commented on Apr 28, 2020

    @wowfood

    Only reference I can find to it, so I'll ask here. If you'd prefer I open an issue, then I will.

    Following the current guides / tutorials when I attempt to launch my application I get the following error

    An unhandled exception occurred while processing the request.
    NullReferenceException: Object reference not set to an instance of an object.
    Microsoft.Identity.Web.AuthorityHelpers.EnsureAuthorityIsV2(string authority)

  4. jennyf19 commented on Apr 28, 2020

    @jennyf19
    Collaborator

    wowfood yes, please open another issue here. Can you also include your appsettings.json file (just remove any sensitive information)? Thank you.

  5. wowfood commented on Apr 28, 2020

    @wowfood

    I figured out the issue in the end. It was a typo in the AppSettings.JSON.

    Switching to a local version of the project made the error much more obvious, once I've got things up and running correctly I'll have another go at using the nuget package instead. Thanks for the quick reply though.

  6. jennyf19 commented on Apr 28, 2020

    @jennyf19
    Collaborator

    wowfood Thanks for the follow-up. I think we can make a better error message, so you don't need to do come here for help. Jean-Marc Prieur (@jmprieur) -> thoughts?

  7. jennyf19 commented on Apr 28, 2020

    @jennyf19
    Collaborator

    Actually, wowfood , we already have an issue tracking this: #66

  8. jmprieur commented on Apr 29, 2020

    @jmprieur
    CollaboratorAuthor

    wowfood : just to be sure, in which part (property) of the AppSettings.json did you have the typo? (#66 is for the app secret, but It's not clear fromt this thread that this is where you had the typo?)

  9. wowfood commented on Apr 29, 2020

    @wowfood

    It wasn't the secret, I'd mistyped the actual section, instead of calling it AzureAdB2C I'd called it AzureAB2C, so technically the issue was it wasn't finding any of it. I'll be honest, for IDs and stuff I'd much prefer something strongly typed. (But that's a me issue, not a package issue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2bugfixed

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions