public Task<AuthenticationResult> Authenticate(Dictionary<string, string> authenticationCtx, IUserService _userService) { if (authenticationCtx["provider"] != PROVIDER_NAME) { return Task.FromResult<AuthenticationResult>(null); } var user = new User() { Id = "viewer" }; return Task.FromResult( AuthenticationResult.CreateSuccess(user, PROVIDER_NAME, authenticationCtx)); }
public static AuthenticationResult CreateSuccess(User user, string provider, Dictionary<string, string> context) { return new AuthenticationResult { Success = true, AuthenticatedUser = user, Provider = provider, AuthenticationContext = context }; }