Closed wimdeblauwe closed 5 years ago
I also tried using Spring Boot 2.1.9 with 2.1.7 of the starter, but I get the same exception as with Spring Boot 2.2.0 with 2.2.0 of the starter.
I managed to fix it by adding a custom claim name
in my Azure AD B2C configuration. The strange thing is that it was then automatically filled in with the Display Name
value. Is this the intention that you need to manually add that extra claim when working with Spring Security?
That is exactly the sample I have used. I created a new b2c directory for testing using only the built-in attributes/claims. It was after looking through the code of the starter that you now also lined that I saw that a name
claim is needed, but that is not available by default when I create a b2c directory with email signup only (I have not tested if adding other socials logins would change that).
Could you shed some light on how to reproduce this?
I just followed the sample tutorial and tried to log on with a user I created through the sign up or sign in user flow.
That's weird cause I could not reproduce it with my AAD B2C tenant.
Any update on this issue?
I just redid everything and now it works. Very strange. I now indeed see the name
claim present, which was not the case before. Maybe there was an update on Azure that fixed it?
Glad to hear that you've made it work. I'm not sure whether there was an update on Azure but it seems like it's good now. Close this issue.
I was just running into the same issue adding 'Display Name' to both the User Attributes and Application Claims fixed this, and the value of this is returned in the 'name' attribute.
The tutorial https://docs.microsoft.com/en-us/azure/java/spring-framework/configure-spring-boot-starter-java-app-with-azure-active-directory-b2c-oidc is not clear on what attributes and cliams should be specified in the user flows.
Hi there! Yes, adding 'Display Name' to user-flow in B2C fixes the issue. But I do not want my users to populate this field. Is there a workaround? Maybe a way to hardcode the value in spring? Not sure how to create a custom policy. But seems like a lot of work for a single attribute.
any help would be greatly appreciated!!!
Kevin
I fixed this by dropping the azure-active-directory-b2c-spring-boot-starter and following this guide, I think name attribute is not mandated using the oauth/v2.0 endpoint but the starter was going to the v1 endpoint: https://github.com/microsoft/azure-spring-boot/wiki/Spring-Security-5.1.x-OIDC-Integration-(For-spring-boot-2.1.x)
Environment
azure-active-directory-b2c-spring-boot-starter:2.2.0
Summary
I tried the tutorial at https://docs.microsoft.com/en-us/java/azure/spring-framework/configure-spring-boot-starter-java-app-with-azure-active-directory-b2c-oidc?view=azure-java-stable#feedback I am able to create an account, but the actual login is not working. The stacktrace shows:
Reproduce steps
Try to log on after creating an account, it keeps showing the /login page
Expected Results
The login works and the /home page is shown
Actual Results
The login page keeps showing. I debugged and there is indeed no
name
property present. I seefamily_name
,given_name
,country
, ... but noname