Skip to content

How to specify authority to MSAL? #1653

Closed Answered by grenzi
grenzi asked this question in Q&A
Discussion options

You must be logged in to vote

Ok. I figured it out. You have to add exactly one scope to the "MsalAuthentication" section of appsettings (at least for my case, using Azure B2C, I get an error otherwise).

In case anyone else comes here looking for the solution, here's what i ended up using in app.cs:

.UseAuthentication(auth =>
    auth.AddMsal(configure => 
        configure.Builder(pcabuilder => pcabuilder
            .WithB2CAuthority("https://TENANTNAME.b2clogin.com/tfp/TENANTNAME.onmicrosoft.com/POLICY")
            .WithClientId("GUID")
#if __WASM__
                    .WithRedirectUri("https://localhost:5000/authentication-callback")
#elif __IOS__ || __MACOS__
                    .WithIosKeychainSecurityGroup("")…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by grenzi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant