private Task <TokenResponse> AuthorizeByHandshakeSecretAsync(CertificateAuthenticationResponse authResponse, IOpenIdClient openId, OpenIdAuthenticationOptions options, TimeSpan?timeout) { var request = new CertificateTokenRequest( cryptoProvider.Decrypt(authResponse.EncryptedKey), credentials.PublicKeyCertificate.Thumbprint, options.Scope, options.ClientId, options.ApiKey); return(openId.RequestTokenAsync(request, timeout)); }
private Task <CertificateAuthenticationResponse> AuthorizeByPublicKeyAsync(IOpenIdClient openId, OpenIdAuthenticationOptions options, TimeSpan?timeout) { var request = new CertificateAuthenticationRequest( credentials.PublicKeyCertificate, credentials.Free, options.ClientId, options.ApiKey); return(openId.CertificateAuthenticationAsync(request, timeout)); }
public async Task <TokenResponse> AuthenticateAsync(IOpenIdClient openId, OpenIdAuthenticationOptions options, TimeSpan?timeout = null) { var authResponse = await AuthorizeByPublicKeyAsync(openId, options, timeout).ConfigureAwait(false); return(await AuthorizeByHandshakeSecretAsync(authResponse, openId, options, timeout).ConfigureAwait(false)); }