Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm working on an Umbraco website for my company intranet. Only employees are authorised so I've set up Google OAuth and an LDAP authentication that then sign into .NET identity.
I've then got a global AuthorizeAttribute that redirects to /Login unless it's handling a BackOfficeController request.
It works pretty well but there seems to be a conflict with the back office. After logging in with the usual Umbraco authentication a completely blank page is shown.
There are 2 errors in the console:
Uncaught SyntaxError: Unexpected token < Login?ReturnUrl=%2Fumbraco%2FServerVariables%3Fumb__rnd%3D26aedbaf%26umb__rnd%3Dundefined.undefined:2
Uncaught SyntaxError: Unexpected token <
No url found for api name legacyTreeJs angular.min.js?cdv=1969968925:63
No url found for api name legacyTreeJs
Where I suppose that the first error is causing the second one that makes angular not run and the page and remain blank.
I thought that my global filter was causing a call to /umbraco/ServerVariables?umb__rnd=26aedbaf&umb__rnd=undefined.undefined to be redirected to /Login but it doesn't trigger a breakpoint in VS and even if I change the global filter to just throw an exception it just keeps happening.
If the user is not logged into identity then it can log into the Umbraco back office just fine!
Have you decorated your controller actions with [Authorize]?
No, I've applied it with an ApplicationEventHandler
public class IdentityEventHandler : ApplicationEventHandler
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
After some more investigation I've found out that the redirect of the call to /umbraco/ServerVariables is due to
LoginPath = new PathString("/Login"),
But now I'm not sure what to do to fix it and why is it causing problems only when I'm logged in with identity and not the other way around :(
Tutorials like this seems to be doing pretty much what I'm doing on a similar Umbraco version.
I've just tried following the same tutorial from scratch with Umbraco 7.4.2 and I'm having the same problem.
Seems like adding
to owin startup just solved it!
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted