-
Notifications
You must be signed in to change notification settings - Fork 996
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
EditProfile Throw error for Azure AD B2C solution "1-WebApp-OIDC/1-5-B2C" #399
Comments
Added Operating system version and .NetCore Version details |
Hi @manoj1201. Could you provide a detailed error message? Also are all the policies specified in config match what's in AAD? |
@pmaytak , Thanks for info. I am using Userflow: Getting below error at local host:- fail: Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler[52] |
@manoj1201 Can you verify which version of Microsoft identity Web package you're using? Try 0.3.0-preview (it's is the latest) if you're not already. @jennyf19 I thought we had a similar issue like this and it was fixed? (Maybe it was 467?) I think the problem was that user flow parameter passed in to |
I could confirm that this reproes in a B2C Web app that sign-ins users (1-WebApp-OIDC/1-5-B2C), but not in a B2C web app that signs-in users and calls a Web API (our test app works well). AnalysisWhat happens, is that in context.ProtocolMessage.ResponseType = OpenIdConnectResponseType.CodeIdToken; When the code is received, Microsoft.Identity.Web does not try to redeem it (because Startup.cs does not contain Suggestion to fix itIn: I suggest we request BTW, @jennyf19, this should also fix [Bug]Template IndividualAuth B2C Password reset uses default policy #467 |
@manoj1201 thanks for raising this issue. We'll fix it ASAP (in Microsoft.Identity.Web) (or if you are using 0.3.0-preview, services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApp(Configuration, "AzureAdB2C")
.EnableTokenAcquisitionToCallDownstreamApi(initialScopes: new string[] { Configuration["TodoList:TodoListScope"] })
.AddInMemoryTokenCaches(); |
Hello @pmaytak As suggested, I changed the nuget package "Microsoft.Identity.Web.UI" & "Microsoft.Identity.Web" with 0.3.0-preview. It asked to change the obsolete function in stratup.cs file. I changed below line services.AddMicrosoftWebAppAuthentication(Configuration, "AzureAdB2C") When the ran the solution and getting same issue, Below is error for your reference Hello @jmprieur |
@manoj1201, it's a work around. We are going to fix this ASAP. Meanwhile, if you don't want to use that work around, you could try the following work around, which should work. services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApp(Configuration, "AzureAdB2C");
services.Configure<OpenIdConnectOptions>(OpenIdConnectDefaults.AuthenticationScheme, options =>
{
var previousOptions = options.Events.OnRedirectToIdentityProvider;
options.Events.OnRedirectToIdentityProvider = async context =>
{
await previousOptions(context);
context.ProtocolMessage.ResponseType = Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectResponseType.IdToken;
};
}); |
Thanks @jmprieur for your quick prompt. Its really appreciable. Modified Function
Looking for permanent fix for this issue. |
@manoj1201 the fix has been merged into master. we'll let you know when we can get out a release. thanks for letting us know about the issue so quickly. |
included in 0.3.1-preview release. thanks again @manoj1201 |
This issue is for a: (mark with an
x
)The issue was found for the following scenario:
Please add an 'x' for the scenario(s) where you found an issue
Repro-ing the issue
Repro steps
Create User flow and configured Sign In and Edit Profile flow with below user attribute
Error Page Url : https://localhost:44316/MicrosoftIdentity/Account/Error
An error occurred while processing your request.
Request ID: |b8a8d858-48bf2c5956a60f9e.
Expected behavior
Edit Profile, When i use User flow run option, It working fine as i used https://jwt.ms as redirect url -> which return me valid token and details. Looks like issue with uploaded solution.
Actual behavior
Possible Solution
Additional context/ Error codes / Screenshots
Any log messages given by the failure
Add any other context about the problem here, such as logs.
OS and Version?
Versions
I am using ASP.NEt Core 3.1
Attempting to troubleshooting yourself:
Mention any other details that might be useful
The text was updated successfully, but these errors were encountered: