-
Greetings, So after some experimentation my collegue and myself have been able to successfully get the OIDC external authorization to work after configuring Azure B2C + Entra ID. We have created new properties on a User that immediately mapped to their Profile within Oqtane and all works extremely well and good. Azure B2C + Entra ID SSOThe last part of the configuration we are struggling with however is the mapping of Azure AD Groups to Oqtane Roles. I want the Azure IT administrator to be able to assign an Azure User Role so that when this person logs in using their SSO, the Roles in Azure are automatically configured within Oqtane. We are at the point where we have created the Group, placed myself as a User within the Group and when I perform an 'User Accounts->Settings->External Login Settings->Review Claims' for tracing what his happeing, I can see the the Group in the Event Log debug text however it is only identified by its Object ID GUID and not by it's name.
Any and all information on this would be appreciated. ~Matt |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
@mattkwid this might help you: Oqtane expects that there is a single claim provided by the IDP where the various role names for the user are identified. These names need to match the role names within Oqtane for the role mapping to function as expected. |
Beta Was this translation helpful? Give feedback.
-
And for anyone else finding this post, we also found the Microsoft Entra Admin Center that makes this whole process a lot clearer. Thank you for the response Shaun. We are very much appreciating the use of your framework so far on our project. I will leave this thread open until we can get all the way there to using the Roles and I will share anything else that may be helpful for others. |
Beta Was this translation helpful? Give feedback.
-
Topic Update:My collegue ended up writing the code to get Entra Id Roles/Groups to map to the Internal UserRoles table in Oqtane. In the end we did not see the code in Oqtane that provided the mapping and custom code was written to handle this. |
Beta Was this translation helpful? Give feedback.
-
@ChadSolberg Oqtane already contains logic for mapping roles from external login providers. However @mattkwid may have encountered an issue with the current implementation. Basically in User Settings you can specify the Role Claim - which is essentially the name of the claim type returned by the IDP which contains the list of roles (ie. "roles": ["Admin", "SuperUser"]). The OIDC configuration in Oqtane uses this value to set the options.TokenValidationParameters.RoleClaimType Then when the IDP returns the JWT token it uses this value to parse the roles from the claim:
however it appears there may be an issue in the above logic - as it is using the default ClaimTypes.Role rather than the type name specified in the ExternalLogin:RoleClaimType User Setting option when extracting the role claims. I will fix this logic. It should also be noted that the above logic assumes the role names returned from the IDP match the role names specified in Oqtane (ie. there is no "mapping" of the external role name to an internal role name). Oqtane could certainly be enhanced to include a configuration for Role Claim Mapping where you could specify "admin:Administrators,private:Registered Users", etc... (similar to the Profile Claim Types mappings) |
Beta Was this translation helpful? Give feedback.
-
@mattkwid I am not sure why I thought this was fully implemented and working - I tested it this week and there were definitely some gaps. #4609 improves the support for roles from external login:
@ChadSolberg I tested this with Microsoft Entra and it works well |
Beta Was this translation helpful? Give feedback.
@mattkwid I am not sure why I thought this was fully implemented and working - I tested it this week and there were definitely some gaps. #4609 improves the support for roles from external login: