public TokenController( IOptions <TokenIssuingOptions> options, ILoginRegistry loginRegistry, IRefreshTokenRegistry refreshTokenRegistry) { _options = options.Value; _loginRegistry = loginRegistry; _refreshTokenRegistry = refreshTokenRegistry; }
public async Task <ErrorTokenResponse> LoadAndCheckLoginRequest(ILoginRegistry loginRegistry, IRefreshTokenRegistry refreshTokenRegistry) { ILoginRequestProvider loginReqProvider; switch (TokenRequest.GrantType) { case TokenRequestChecker.AuthCodeGrantType: loginReqProvider = new AuthCodeBasedLoginRequestProvider(TokenRequest.AuthCode, loginRegistry); break; case TokenRequestChecker.RefreshTokenGrantType: loginReqProvider = new RefreshTokenBasedLoginRequestProvider(TokenRequest.RefreshToken, refreshTokenRegistry); break; default: throw new IndexOutOfRangeException("Unsupported grant type"); } LoginRequest = await loginReqProvider.Provide(); return(_tokenRequestChecker.Value.CheckLoginRequest(LoginRequest)); }
public LoginController(ILoginRegistry loginRegistry, IClientRegistry clientRegistry) { _loginRegistry = loginRegistry; _requestChecker = new LoginRequestChecker(clientRegistry); }
/// <summary> /// Initializes a new instance of <see cref="AuthCodeBasedLoginRequrestProvider"/> /// </summary> public AuthCodeBasedLoginRequestProvider(string authCode, ILoginRegistry loginRegistry) { _authCode = authCode; _loginRegistry = loginRegistry; }