I'm trying to retrieve all claims of a backoffice user from AzureB2C based on https://docs.umbraco.com/umbraco-cms/tutorials/add-google-authentication.
Only users that are part of the group "admin" are allowed to autolink. When the authentication is succesfull only 5 claims are received like name and email. No "group" claims in this list. Does anyone have an idea or tip?
b
Bram
11/23/2023, 8:02 PM
I've worked with custom azure b2c policies before and by default an user flow does not return the groups that an user is part of in the claims. Are you using a custom policy or an user flow?
j
jorritschippers
11/23/2023, 8:25 PM
No I use the same as the tutorial, but then for AzureB2C. No custom policies or user flows.
b
Bram
11/23/2023, 10:28 PM
I might not have understood the question then. You're trying to implement Google authentication (as per tutorial link) but are also using B2C (the only option for using B2C is either via custom policy or user flow). Can you elaborate further on the question?
j
jorritschippers
11/24/2023, 7:54 AM
I added a external login provider for users based on this link: https://docs.umbraco.com/umbraco-cms/tutorials/add-google-authentication. Since I am using AzureB2C is edited the "AddGoogleAuthentication" method using the ConfigureAuthenticationMethod from: https://docs.umbraco.com/umbraco-cms/tutorials/add-azure-active-directory-authentication. Using this a Microsoft button is added to the login screen for the backoffice I can use to login with SSO.
When I debug and put a breakpoint in the OnExternalLogin method from the UserExternalLoginProviderOptions I can see the received loginInfo. The Principal field contains Claims. It would be ideal if I can receive de "group" claims in this method. So I'm only using the tutorials as an extention on a newly created Umbraco 10.7.0 project.
b
Bram
11/24/2023, 5:42 PM
You have added a client id and a client secret, this corresponts with an azure AD b2c that you have in your Azure environment. Can you tell me how you've configured that? By default azure B2C does not return user groups
j
jorritschippers
11/25/2023, 10:49 AM
The permissions "Group.Read.All" and "GroupMember.Read.All" are enabled on the client in the Azure environment