public void Authenticate(IAuthenticateContext context) { if (PriorHandler != null) { PriorHandler.Authenticate(context); ApplyTransform(context); } }
public async Task AuthenticateAsync(IAuthenticateContext context) { if (PriorHandler != null) { await PriorHandler.AuthenticateAsync(context); ApplyTransform(context); } }
private void ApplyTransform(IAuthenticateContext context) { if (_transform != null) { // REVIEW: this cast seems really bad (missing interface way to get the result back out?) var authContext = context as AuthenticateContext; if (authContext?.Result?.Principal != null) { context.Authenticated( _transform.Invoke(authContext.Result.Principal), authContext.Result.Properties.Dictionary, authContext.Result.Description.Dictionary); } } }
public virtual void Authenticate(IAuthenticateContext context) { if (context.AuthenticationTypes.Contains(BaseOptions.AuthenticationType, StringComparer.Ordinal)) { AuthenticationTicket ticket = Authenticate(); if (ticket != null && ticket.Identity != null) { context.Authenticated(ticket.Identity, ticket.Properties.Dictionary, BaseOptions.Description.Dictionary); } else { context.NotAuthenticated(BaseOptions.AuthenticationType, properties: null, description: BaseOptions.Description.Dictionary); } } if (PriorHandler != null) { PriorHandler.Authenticate(context); } }
public virtual void Authenticate(IAuthenticateContext context) { if (ShouldHandleScheme(context.AuthenticationScheme)) { var ticket = Authenticate(); if (ticket?.Principal != null) { AuthenticateCalled = true; context.Authenticated(ticket.Principal, ticket.Properties.Dictionary, BaseOptions.Description.Dictionary); } else { context.NotAuthenticated(); } } if (PriorHandler != null) { PriorHandler.Authenticate(context); } }
public virtual async Task AuthenticateAsync(IAuthenticateContext context) { if (ShouldHandleScheme(context.AuthenticationScheme)) { var ticket = await AuthenticateAsync(); if (ticket?.Principal != null) { AuthenticateCalled = true; context.Authenticated(ticket.Principal, ticket.Properties.Dictionary, BaseOptions.Description.Dictionary); } else { context.NotAuthenticated(); } } if (PriorHandler != null) { await PriorHandler.AuthenticateAsync(context); } }
public Task AuthenticateAsync(IAuthenticateContext context) { throw new NotImplementedException(); }
public void Authenticate(IAuthenticateContext context) { throw new NotImplementedException(); }
public virtual async Task AuthenticateAsync(IAuthenticateContext context) { if (context.AuthenticationTypes.Contains(BaseOptions.AuthenticationType, StringComparer.Ordinal)) { AuthenticationTicket ticket = await AuthenticateAsync(); if (ticket != null && ticket.Identity != null) { context.Authenticated(ticket.Identity, ticket.Properties.Dictionary, BaseOptions.Description.Dictionary); } else { context.NotAuthenticated(BaseOptions.AuthenticationType, properties: null, description: BaseOptions.Description.Dictionary); } } if (PriorHandler != null) { await PriorHandler.AuthenticateAsync(context); } }