Umbraco Backoffice & Azure Active Directory Redire...
# help-with-umbraco
j
I'm looking to use Azure Active Directory for allowing Users to log-in to the Umbraco backoffice ([docs](https://docs.umbraco.com/umbraco-cms/v/10.latest-lts/reference/security/authenticate-with-active-directory)). The final hurdle is that, when attempting to log-in, I'm receiving an Azure error stating that my 'redirect_uri' is not valid. Currently I am using https://localhost:44370/umbraco/ as my redirect URI, a method validated by @shazwazza. 's excellent 2018 blog post [Configuring Azure Active Directory login with Umbraco](https://shazwazza.com/post/configuring-azure-active-directory-login-with-umbraco/). However this is still resulting in the same error. Does anyone have any suggestions with what I can do to resolve this? Annoyingly the same error shows up if my options.ClientSecret value is incorrect, so for this field I'm using the Value field of a Client Secret (i.e. the one starting nw6). I have been using the Secret ID field but that's definitely Not It. (I'm now going to be blissfully AFK for the next 24 hours - thank you UK bank holidays - so apologies for late responses. If anyone has any suggestions that would make my return to work that much less stressful!)
n
Should to return URL be diffrent? The callBackPath? - /umbraco-microsoft-signin/
j
AH - ok that's something; from the docs we get:
Copy code
//By default this is '/signin-microsoft' but it needs to be changed to this
                                options.CallbackPath = "/umbraco-signin-microsoft/";
And registering that has worked! BUT now if we just go in with the AAD account we get a white screen and the included console errors - I'm assuming this is because the Umbraco instance doesn't have this random AAD person registered as an account. I've just tried registering an Umbraco account with the AAD account, but it's still getting the same result (it's also automatically logging in, so I've just got to clear a cache!)
k
The URLs need to match exactly, including paths and queries. Register some more redirect URLs in Azure so that anything you send from Umbraco is there.
The secret ID is not the secret itself. It's the obfuscated
value
you should use.
j
Yeah that was a fun thing to realise.
^white screen when using AAD to log-in
n
Yep, ive been battling this for Umbraco 12 for a couple of weeks, i get the blank screen as well, not sure why. Still investigating
j
Ok nice - for me that's at least A Step Forward. Might log as an issue on GitHub?
Here's the demo of the error:

https://www.youtube.com/watch?v=x2MBnUfZN6U

n
Yup, that is exactly the error i get as well GetCurrentUser. I also have used the Umbraco.Community.AzureSSO package and again get the exact same blank screen and console errors
j
FYI this is in the white page's HTML: "The requested provider (Umbraco.Microsoft) has not been linked to an account, the provider must be linked from the back office."
Ah so this has been raised a few times before - Bjarke's response is that Umbraco has a hard requirement to have email addresses, which, in my mind, defeats the point of using SSO via Azure AD etc: https://github.com/umbraco/Umbraco-CMS/issues/13100
Interesting update; could be an issue based on not setting ClaimsTypes: https://github.com/umbraco/Umbraco-CMS/issues/14741
n
Hmm yeh interesting, will try and have a look into it, but did see they were adding it as a sprint candidate to be fixed?
@jacksorjacksor (Richard Jackson) Did you get this working?
m
@jacksorjacksor (Richard Jackson) in the docs you linked did you add options.AutoLinkOptions
j
Morning @Neil / @Matthew Hart - this part of the project has been put on the back burner for a while so I haven't had time/capacity to look into it - apologies. When I do I'll report back.
n
@jacksorjacksor (Richard Jackson) no worries, and no rush of course was just curious if you found a resolution. We are the same and have shelved it for now until it comes back around into the Sprint. I'll also update here if i get any closer 🙂
4 Views