public void SignIn(SignInContext context) { if (PriorHandler != null) { PriorHandler.SignIn(context); } }
public Task SignInAsync(SignInContext context) { if (PriorHandler != null) { return PriorHandler.SignInAsync(context); } return Task.FromResult(0); }
public override async Task SignInAsync([NotNull] string authenticationScheme, [NotNull] ClaimsPrincipal principal, AuthenticationProperties properties) { var handler = HttpAuthenticationFeature.Handler; var signInContext = new SignInContext(authenticationScheme, principal, properties?.Items); if (handler != null) { await handler.SignInAsync(signInContext); } if (!signInContext.Accepted) { throw new InvalidOperationException($"The following authentication scheme was not accepted: {authenticationScheme}"); } }
public Task SignInAsync(SignInContext context) { SignedIn = true; context.Accept(); return Task.FromResult(0); }
public Task SignInAsync(SignInContext context) { throw new NotImplementedException(); }
protected override Task HandleSignInAsync(SignInContext context) { return Task.FromResult(0); }
public virtual void SignIn(SignInContext context) { if (ShouldHandleScheme(context.AuthenticationScheme)) { SignInContext = context; SignOutContext = null; context.Accept(); } if (PriorHandler != null) { PriorHandler.SignIn(context); } }
public Task SignInAsync(SignInContext context) { return Task.FromResult(0); }
public Task SignInAsync(SignInContext context) { // Not supported, fall through if (PriorHandler != null) { return PriorHandler.SignInAsync(context); } return Task.FromResult(0); }
public override async Task SignInAsync(string authenticationScheme, ClaimsPrincipal principal, AuthenticationProperties properties) { if (string.IsNullOrEmpty(authenticationScheme)) { throw new ArgumentException(nameof(authenticationScheme)); } if (principal == null) { throw new ArgumentNullException(nameof(principal)); } var handler = HttpAuthenticationFeature.Handler; var signInContext = new SignInContext(authenticationScheme, principal, properties?.Items); if (handler != null) { await handler.SignInAsync(signInContext); } if (!signInContext.Accepted) { throw new InvalidOperationException($"No authentication handler is configured to handle the scheme: {authenticationScheme}"); } }
public void SignIn(SignInContext context) { throw new NotImplementedException(); }
public override async Task SignInAsync(string authenticationScheme, ClaimsPrincipal principal, AuthenticationProperties properties) { if (string.IsNullOrEmpty(authenticationScheme)) { throw new ArgumentException(nameof(authenticationScheme)); } if (principal == null) { throw new ArgumentNullException(nameof(principal)); } var handler = HttpAuthenticationFeature.Handler; var signInContext = new SignInContext(authenticationScheme, principal, properties?.Items); if (handler != null) { await handler.SignInAsync(signInContext); } //NOTE (Sebnema): If I remove lock, even though "signInContext.Accepted" is true, it will throw exception. // Added lock to all if(signInContext.Accepted) statements. lock (thisLock) { if (!signInContext.Accepted) { throw new InvalidOperationException($"No authentication handler is configured to handle the scheme: {authenticationScheme}"); } } }
protected virtual Task HandleSignInAsync(SignInContext context) { return Task.FromResult(0); }
public async Task SignInAsync(SignInContext context) { if (ShouldHandleScheme(context.AuthenticationScheme)) { SignInAccepted = true; await HandleSignInAsync(context); context.Accept(); } if (PriorHandler != null) { await PriorHandler.SignInAsync(context); } }