Get Azure Login Status From Backoffice
# help-with-umbraco
r
I'm currently using the community AzureSSO package to enable login via an Azure AD and am wanting to add additional functionality into the back office for only the users who logged in via the Azure SSO. Local sign-in is still allowed. I've explored the
authResource
, leading into the
currentUser
object and explored the Azure package source but can't find any variable that gets set that I can hook into with my Angular script. I did find that users who went through Azure had a new cookie called
ARRAffinity
but it's HttpOnly so can't access that in my Javascript. Does anyone know a way I can achieve this please? I'm using Umbraco 13. Package link: https://github.com/Gibe/Umbraco.Community.AzureSSO
j
Haven't worked with this package, but got curious so just a suggestion here: I can see that it will attempt to set groups based on Azure user roles if there is a user group matching the name: https://github.com/Gibe/Umbraco.Community.AzureSSO/blob/main/src/Umbraco.Community.AzureSSO/MicrosoftAccountBackOfficeExternalLoginProviderOptions.cs#L93 If you have a default role in Azure for all users and create a user group with that name you could do a check on that role as an access criteria to the extra functionality for SSO users?
r
That's an interesting shout; hadn't thought of checking for additional groups. There's a logger in there so I'll dig a little deeper. 👌🏻
4 Views