davidjrh / dnn.azureadprovider

The DNN Azure Active Directory Provider is an Authentication provider for DNN Platform (formerly DotNetNuke) that uses Azure Active Directory OAuth2 authentication to authenticate users.
MIT License
35 stars 22 forks source link

GetToken issue once returned back to DNN website #1

Closed iiminov closed 7 years ago

iiminov commented 8 years ago

Hi, looking for tiny bit of help with this one.

After I had no joy with an existing installation (upgraded to 7.4.2) I've setup a clean 7.4.2 installation on my dev server. I then installed Azure Provider 1.0.1 and configured it with relevant Azure AD endpoints. At this stage I get Login with Azure button which redirects me to my portal where I login. When I am redirected back I get an exception and no login.

TabId:55

RawUrl:/Login?code=AAABAAAAiL9Kn2Z27UubvWFPbm0gLX5sMXzAHCesPzNYN5YkcQKQq5V2Id8uzfKhP-7PeAz27qIPniM3xwTBkjvregiRW6W-b3LxT-FRYs1mCmg20BmptXfXVSPARfWhTjLI8N6-nXhUy58l6ivSe24NU7ZQ7QQYj3oFUr3J7uZbGX3J0EwtqAChzktkoZnNj0FWexUehlW1gPfA3jfDPmVBNfbtYg2HqfhqJEnFPVNc3hY9Rg6frhc2

InnerMessage:There was an error processing the credentials. Contact your system administrator.

InnerStackTrace:
   at DotNetNuke.Authentication.Azure.Components.AzureClient.GetToken(String responseText) in c:\hosting\dnn742\DesktopModules\AuthenticationServices\Azure\Components\AzureClient.cs:line 78
   at DotNetNuke.Services.Authentication.OAuth.OAuthClientBase.ExchangeCodeForToken() in c:\hosting\dnn742\DesktopModules\Library\Services\Authentication\OAuth\OAuthClientBase.cs:line 278
   at DotNetNuke.Services.Authentication.OAuth.OAuthClientBase.AuthorizeV2() in c:\hosting\dnn742\DesktopModules\Library\Services\Authentication\OAuth\OAuthClientBase.cs:line 237
   at DotNetNuke.Services.Authentication.OAuth.OAuthLoginBase.OnLoad(EventArgs e) in c:\hosting\dnn742\DesktopModules\Library\Services\Authentication\OAuth\OAuthLoginBase.cs:line 73
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

So, at this stage I am a bit lost. Is there a sure way to test/know if I am getting the correct token?

The RawURL property from events log has a long code string of something. Is this what I am expecting from Azure AD?

Any pointers or help is much appreciated.

iiminov commented 8 years ago

My apologies. I managed solve my problem. It boiled down to incorrect CLIENT ID used with module configuration.

iiminov commented 8 years ago

Just in case someone is interested I ended up testing with both 7.4.1 and 7.4.2 installs. And both work once you get your endpoints and configs right.

davidjrh commented 7 years ago

Closing, not an issue any more. With the v3.0.0, the configuration process is easier so this type of issues should not happen :)