- ABP Framework version: v5.1
- UI type: MVC
- DB provider: EF Core / MongoDB
- Tiered (MVC) or Identity Server Separated (Angular): yes
- Exception message and stack trace:
- Steps to reproduce the issue:"
We are trying to Use Azure AD integration for Login process and it is working as expected Step 1: User trying to Login with xxx@sample.com Step 2: Azure AD Login page displayed Step 3: Provided the correct info of xxx@sample.com Step 4: Redirected to Register page and clicked on Register Step 5: User Created and logged into Application
but the same is not the case with different scenario
Step 1: Logged in as Admin and created a user with pqr@sample.com and assigned the permissions Step 1: User trying to Login with pqr@sample.com Step 2: Azure AD Login page displayed Step 3: Provided the correct info of pqr@sample.com Step 4: Redirected to Register page and clicked on Register (we assume this shouldn't be the case as we have a user with same username/email, we are expecting to login without any other steps ) Step 5: User Already exists message popped up
In the above case SignInManager.ExternalLoginSignInAsync is returning failed.
Can you please help what might be missing?? Thanks in advance
9 Answer(s)
-
0
Can you check the logs?
Also you can override the SignInManager and debug then see what's going on.
-
0
Step 4: Redirected to Register page and clicked on Register
Did the Register page get your email address?
-
0
Step 4: Redirected to Register page and clicked on Register
Did the Register page get your email address?
Yes we are getting the email pre populated in Register page
-
0
hi
Please share your
Azure AD integration
code. egAddAuthentication().Add
-
0
-
0
hi
Try to add this
options.ClaimActions.MapJsonKey(AbpClaimTypes.Email, "email");
-
0
-
0
hi
Add
UserInformationReceived
callback to debug and check theprincipal
.options.Events = new OpenIdConnectEvents() options.Events.UserInformationReceived = ...
-
0
hi
Add
UserInformationReceived
callback to debug and check theprincipal
.options.Events = new OpenIdConnectEvents() options.Events.UserInformationReceived = ...
After changing the claim type from ABPClaimType to ClaimType it worked. Means some issue with the Key used.
var email = loginInfo.Principal.FindFirstValue(ClaimTypes.Email);
Thanks for the support.