Issue Signing in with Azure AD using HTTPS

Posted by Community Admin on 04-Aug-2018 14:46

Issue Signing in with Azure AD using HTTPS

All Replies

Posted by Community Admin on 03-Nov-2015 00:00

I'm getting the following error when I try to sign in using Azure Active Directory as my external sts, using https.

This is happening during the custom Authentication Handler which extends the SecurityTokenServiceHttpHandler, after it successfully authenticates the token returned from Azure AD, and moves onto the Sitefinity ProcessRequest method.

Error line of code: base.ProcessRequest(context);

[HttpException (0x80004005): Access denied] Telerik.Sitefinity.Security.Claims.SecurityTokenServiceHttpHandler.ValidateRequestSource(HttpContextBase context) +570 Telerik.Sitefinity.Security.Claims.SecurityTokenServiceHttpHandler.ProcessRequest(HttpContextBase context) +889

 

The weird thing is that if i just hit the same page again, it processes through the request fine, and logs in the user. Also, I don't get this error when it returns to the non HTTPS version of the SWT (localhost/.../SWT)

Thank you.

Posted by Community Admin on 29-Apr-2016 00:00

Just in case anyone stumbles across this and has the same issue.  I have found a workaround.  It looks like the reason this happens is that the ProcessRequest function in the base SecurityTokenServiceHttpHandler doesn't like when the Request.Headers["Referer"] is an external HTTPS address.

So, before I call the base.ProccessRequest(context) I change that header value to the SWT url using:

context.Request.Headers["Referer"] = "<Domain>/Sitefinity/Authenticate/SWT";

Posted by Community Admin on 01-Jun-2016 00:00

bryber. I owe you a beer. Kept on getting that error in Opera / Incognito Chrome and couldnt figure it out. Adding the Referer resolved my issue.

Posted by Community Admin on 01-Jun-2016 00:00

Glad I could help!  Also I found that it didn't work in Safari, however adding the following in addition to the "Referer" line fixed it:

context.Request.Headers["Origin"] = "<Domain>/Sitefinity/Authenticate/SWT";

This thread is closed