/// <summary> /// Initializes a new instance of the <see cref="WebServerClient"/> class. /// </summary> /// <param name="authorizationServer">The authorization server.</param> /// <param name="clientIdentifier">The client identifier.</param> /// <param name="clientCredentialApplicator"> /// The tool to use to apply client credentials to authenticated requests to the Authorization Server. /// May be <c>null</c> for clients with no secret or other means of authentication. /// </param> public WebServerClient(AuthorizationServerDescription authorizationServer, string clientIdentifier, ClientCredentialApplicator clientCredentialApplicator) : base(authorizationServer, clientIdentifier, clientCredentialApplicator) { }
/// <summary> /// Applies the default client authentication mechanism given a client secret. /// </summary> /// <param name="secret">The client secret. May be <c>null</c></param> /// <returns>The client credential applicator.</returns> protected static ClientCredentialApplicator DefaultSecretApplicator(string secret) { return(secret == null?ClientCredentialApplicator.NoSecret() : ClientCredentialApplicator.NetworkCredential(secret)); }
/// <summary> /// Initializes a new instance of the <see cref="ClientBase"/> class. /// </summary> /// <param name="authorizationServer">The token issuer.</param> /// <param name="clientIdentifier">The client identifier.</param> /// <param name="clientCredentialApplicator"> /// The tool to use to apply client credentials to authenticated requests to the Authorization Server. /// May be <c>null</c> for clients with no secret or other means of authentication. /// </param> protected ClientBase(AuthorizationServerDescription authorizationServer, string clientIdentifier = null, ClientCredentialApplicator clientCredentialApplicator = null) { this.AuthorizationServer = authorizationServer; this.Channel = new OAuth2ClientChannel(); this.ClientIdentifier = clientIdentifier; this.ClientCredentialApplicator = clientCredentialApplicator; }
/// <summary> /// Initializes a new instance of the <see cref="UserAgentClient"/> class. /// </summary> /// <param name="authorizationEndpoint">The authorization endpoint.</param> /// <param name="tokenEndpoint">The token endpoint.</param> /// <param name="clientIdentifier">The client identifier.</param> /// <param name="clientCredentialApplicator"> /// The tool to use to apply client credentials to authenticated requests to the Authorization Server. /// May be <c>null</c> for clients with no secret or other means of authentication. /// </param> public UserAgentClient(Uri authorizationEndpoint, Uri tokenEndpoint, string clientIdentifier, ClientCredentialApplicator clientCredentialApplicator) : this(new AuthorizationServerDescription { AuthorizationEndpoint = authorizationEndpoint, TokenEndpoint = tokenEndpoint }, clientIdentifier, clientCredentialApplicator) { }