active-directory-aspnetcore-webapp-openidconnect-v2
active-directory-aspnetcore-webapp-openidconnect-v2 copied to clipboard
App redirects to RedirectURI Without Running Flow
This issue is for a: (mark with an x)
- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [x ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)
The issue was found for the following scenario:
Please add an 'x' for the scenario(s) where you found an issue
- Web app that signs in users
- [ ] with a work and school account in your organization: 1-WebApp-OIDC/1-1-MyOrg
- [ ] with any work and school account: /1-WebApp-OIDC/1-2-AnyOrg
- [ ] with any work or school account or Microsoft personal account: 1-WebApp-OIDC/1-3-AnyOrgOrPersonal
- [ ] with users in National or sovereign clouds 1-WebApp-OIDC/1-4-Sovereign
- [ ] with B2C users 1-WebApp-OIDC/1-5-B2C
- Web app that calls Microsoft Graph
- [ ] Calling graph with the Microsoft Graph SDK: 2-WebApp-graph-user/2-1-Call-MSGraph
- [ ] With specific token caches: 2-WebApp-graph-user/2-2-TokenCache
- [ ] Calling Microsoft Graph in national clouds: 2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph
- [ ] Web app calling several APIs 3-WebApp-multi-APIs
- [ ] Web app calling your own Web API
- [ ] with a work and school account in your organization: 4-WebApp-your-API/4-1-MyOrg
- [ ] with B2C users: 4-WebApp-your-API/4-2-B2C
- [ ] with any work and school account: 4-WebApp-your-API/4-3-AnyOrg
- Web app restricting users
- [ ] by Roles: 5-WebApp-AuthZ/5-1-Roles
- [ ] by Groups: 5-WebApp-AuthZ/5-2-Groups
- [ ] Deployment to Azure
- [x ] Other (please describe)
Repro-ing the issue
Follow the current instructions under "Configure authentication in a sample web app by using Azure AD B2C" including the prerequisites up to and including Step 5, point 3 but without being previously signed in.
Expected behavior I am presented with the user flow, configured in "Set up a sign-up and sign-in flow in Azure Active Directory B2C"
Actual behavior I am redirected to the RedirectURI without having to sign up or sign in and the JWT is empty.
Additional context/ Error codes / Screenshots
I am following the guide here: https://docs.microsoft.com/en-gb/azure/active-directory-b2c/configure-authentication-sample-web-app
I'm brand new to B2C so there is probably something very basic I'm missing.
The following 2 lines from my output window may be useful: Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request starting HTTP/2 GET https://localhost:44316/MicrosoftIdentity/Account/SignIn? - - Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler: Information: OpenIdConnect was not authenticated. Failure message: Not authenticated
Im also facing the same issue.
after i changed appsetting.json to my client and instance details, when i click on signup/signin app redirects to localhost without prompting for user credentials.
Any help is appreciated.
@jamesW360DotNet @mohamedalijinnah
In your appsettings.json file do you have the following line uncommented?
"CallbackPath": "/signin/B2C_1_sign_up_in"
By default your application will use https://localhost:44316/signin-oidc as the login path for your application.
When you have this line uncommented but your application is configured to use https://localhost:44316/signin-oidc in the portal instead what will happen is your application will be configured to expect a redirect URL of https://localhost:44316/signin/B2C_1_sign_up_in but the server will send a post request to https://localhost:44316/signin-oidc which would trigger the failure you're seeing.
Simplest solution would be to comment that line out in appsettings.json and add https://localhost:44316/signin-oidc as a redirect URI for your application in Azure.
Step 2 in the document referenced.
Let me know if this helps.
No response. Closing.
Please feel free to re-open if this issue is not resolved.