I have some weired problems or misunterstanding with my OWIN Implementation. I build up a middleware after reading many examples.
In the AuthenticateCoreAsync function, I get a complete AuthenticationTicket based on the UmbracoBackOfficeIdentiy, but I am not logged in. Do I miss some steps?
Attach you will find my AuthenticationHandler Implementation.
(Code is just for understanding and debugging)
Thx in advance
Regards
Marcel
protected override Task<AuthenticationTicket> AuthenticateCoreAsync()
{
if (ShouldAuthRequest())
{
var authTicket = GetAuthTicket(Request, UmbracoConfig.For.UmbracoSettings().Security.AuthCookieName);
if (authTicket != null)
{
return Task.FromResult(new AuthenticationTicket(authTicket, new AuthenticationProperties()));
}
}
return Task.FromResult<AuthenticationTicket>(null);
}
private UmbracoBackOfficeIdentity GetAuthTicket(IOwinRequest request, string cookieName)
{
if (request == null) throw new ArgumentNullException("request");
var signManager = Context.GetBackOfficeSignInManager();
var userManager = Context.GetBackOfficeUserManager();
var identityUser = userManager.FindByEmail("[email protected]");
var claim = identityUser.GenerateUserIdentityAsync(userManager);
var authorisation = (UmbracoBackOfficeIdentity)claim.Result;
return authorisation;
}
Custom OWIN Backoffice Authentication
Hey everyone,
I have some weired problems or misunterstanding with my OWIN Implementation. I build up a middleware after reading many examples.
In the AuthenticateCoreAsync function, I get a complete AuthenticationTicket based on the UmbracoBackOfficeIdentiy, but I am not logged in. Do I miss some steps?
Attach you will find my AuthenticationHandler Implementation.
(Code is just for understanding and debugging)
Thx in advance
Regards
Marcel
is working on a reply...