Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sign up / Sign in failed #118

Closed
guobinC opened this issue Dec 15, 2021 · 4 comments
Closed

Sign up / Sign in failed #118

guobinC opened this issue Dec 15, 2021 · 4 comments

Comments

@guobinC
Copy link

guobinC commented Dec 15, 2021

I cloned the source code 15 Dec 2021, use VS2019 to build on master branch and run. Without any code change, try to Sign up / Sign in, it reports:

Processing of the HTTP request resulted in an exception. Please see the HTTP response returned by the 'Response' property of this exception for details.

image

Same error when I tried to use my own B2C instance.

@guobinC
Copy link
Author

guobinC commented Dec 15, 2021

After set breakpoint to
notification.Response.Redirect("/Home/Error?message=" + notification.Exception.Message);

the detail error message is:

Unable to get authorization code Could not load file or assembly 'Microsoft.Identity.Client, Version=4.37.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040).

@Turbo549
Copy link
Contributor

I issued pull request #119 to address this and to fix a problem that was occurring when your B2C policy names use mixed case and TasksController.AcquireTokenForScopes() calls were failing to silently acquire a token to access the sample API.

@hercul1017
Copy link

hercul1017 commented Dec 17, 2021

I had the same problem and adding "/tfp" to AadInstance parameter in web.config fixed it.

<add key="ida:AadInstance" value="https://parrotexamcom.b2clogin.com/tfp/{0}/{1}" />

I could login, however api call fails now.

Account always null, GetAccountAsync could not find any account in AcquireTokenForScopes method.

var account = await cca.GetAccountAsync(ClaimsPrincipal.Current.GetB2CMsalAccountIdentifier());

My user flows are named by using capital letters like B2C_1_SIGNUP_SIGNIN. Thanks to @Turbo549, by changing web.config values to lower case like b2c_1_signup_signin fixed the issue. Now the sample apps are working for me.

@ganeshan
Copy link

I can confirm that changing from B2C_1_SignupAndSignIn to b2c_1_signupandsignin in
<add key="ida:SignUpSignInPolicyId" value="b2c_1_signupandsignin" /> fixed the problem calling API. The whole sample works as expected.

@pmaytak pmaytak closed this as completed Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants