public static async Task<Flow> Get ( IOwinContext owinContext, OAuthOptions options, AuthorizationCodeStorage authCodeStorage, RefreshTokenStorage refreshTokenStorage ) { var request = new AuthenticationRequest(owinContext); await request.LoadAsync(); var context = new OAuthContext(options, request, owinContext); switch (context.AuthenticationRequest.response_type?.Trim()) { case "code": return new AuthorizationCodeFlow(context, authCodeStorage); case "id_token": return new ImplicitFlow(context); case "id_token token": return new ImplicitFlow(context); case "code id_token": return new HybridFlow(context); case "code token": return new HybridFlow(context); case "code id_token token": return new HybridFlow(context); default: return null; } }
public OAuthContext(OAuthOptions options, AuthenticationRequest request, IOwinContext context) { Options = options; AuthenticationRequest = request; OwinConext = context; }