Maui Azure B2C Login returns empty AccessToken

Viewed 61

I have implemented the Azure B2C authentication from this documentation. I did receive a token but my web api always returned 401. I assume, the docs are not valid for Azure B2C but only for Azure AD.

I was playing around a little bit and I found that the PublicClientApplicationBuilder class used in the described PlatformService class has a different method for setting the authority. It looks like this now:

var clientBuilder = PublicClientApplicationBuilder
    .Create(Constants.ApplicationId)
    .WithB2CAuthority( Constants.AuthoritySignIn);
    //.WithAuthority(AzureCloudInstance.AzurePublic, "common");

When I try to sign in now, I even get the right UserFlow. Unfortunately the return value always has an empty AccessToken and no claims.

0 Answers
Related