Emaborsa
Emaborsa

Reputation: 2860

Microsoft.IdentityModel does not support a B2C issuer with 'tfp' in the URI

I am trying to run the WebApp B2C sample: https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master/1-WebApp-OIDC/1-5-B2C

When I try to login, I get the following error:

IDX40002: Microsoft.IdentityModel does not support a B2C issuer with 'tfp' in the URI. See https://aka.ms/ms-id-web/b2c-issuer for details.

If I edit the Instance to https://myHost.b2clogin.com I get:

AADSTS50011: The redirect URI 'https://myHost.b2clogin.com/1c2009bb-7e35-4a0e-9f22-xxxxxxxxx/oauth2/authresp' specified in the request does not match the redirect URIs configured for the application 'c24b0337-0bd9-45ee-8376-xxxxxxxxx'. Make sure the redirect URI sent in the request matches one added to your application in the Azure portal. Navigate to https://aka.ms/redirectUriMismatchError to learn more about how to fix this.

Edit: These are my redirects: enter image description here

Upvotes: 0

Views: 737

Answers (2)

Emaborsa
Emaborsa

Reputation: 2860

After a long research I found this article/sample, where the Microsoft.Identity.UI framework is replaced with the Microsoft.AspNetCore.Authentication.AzureADB2C.UI. However, with the https://myDomain.b2clogin.com url I still get the same error, using the custom domain it works, that's enough for me.

Upvotes: 0

Sridevi
Sridevi

Reputation: 22512

I tried to reproduce the same in my environment and got the below results:

I deployed custom policy starter pack via IEF Setup App by entering my Azure B2C tenant name like below:

enter image description here

When I checked that in Portal, custom policies are created successfully like below:

enter image description here

Now I registered one Azure AD B2C app named webapp1 as below:

enter image description here

I added redirect Uri to the above application like below: https://localhost:44316/signin-oidc

enter image description here

Now, I followed the same link that you mentioned and deployed one sample B2C web application by modifying appsettings.json file like below:

"AzureAdB2C": {
    "Instance": "https://sridevib2c.b2clogin.com",
    "ClientId": "9986e76d-bxx7-4x6x-bxx7-3d8xxxxx9a45",
    "Domain": "sridevib2c.onmicrosoft.com",
    "SignedOutCallbackPath": "/signout/B2C_1A_SIGNUP_SIGNIN",
    "SignUpSignInPolicyId": "B2C_1A_SIGNUP_SIGNIN",
    "ResetPasswordPolicyId": "B2C_1A_PASSWORDRESET",
    "EditProfilePolicyId": "B2C_1A_PROFILEEDIT" // Optional profile editing policy
    //"CallbackPath": "/signin/B2C_1A_SIGNUP_SIGNIN"  // defaults to /signin-oidc
  },

JSON file:

enter image description here

When I ran the above web application, it took me to below web page:

enter image description here

After selecting Sign Up/In, I got the login screen like below:

enter image description here

When I entered my credentials, I logged in to the application successfully like below:

enter image description here

When I clicked on Sign Out, it showed me below screen by signing me out:

enter image description here

Upvotes: 1

Related Questions