Table of Contents

Class OAuth2ClientBuilder

Namespace
RabbitMQ.Client.OAuth2
Assembly
RabbitMQ.Client.OAuth2.dll
public class OAuth2ClientBuilder
Inheritance
OAuth2ClientBuilder
Inherited Members

Constructors

OAuth2ClientBuilder(string, string, Uri?, Uri?)

Create a new builder for creating OAuth2Clients.

public OAuth2ClientBuilder(string clientId, string clientSecret, Uri? tokenEndpoint = null, Uri? issuer = null)

Parameters

clientId string

Id of the client

clientSecret string

Secret of the client

tokenEndpoint Uri

Endpoint to receive the Access Token

issuer Uri

Issuer of the Access Token. Used to automaticly receive the Token Endpoint while building

Remarks

Either tokenEndpoint or issuer must be provided.

Methods

AddRequestParameter(string, string)

Add a additional request parameter to each HTTP request.

public OAuth2ClientBuilder AddRequestParameter(string param, string paramValue)

Parameters

param string

Name of the parameter

paramValue string

Value of the parameter

Returns

OAuth2ClientBuilder

BuildAsync(CancellationToken)

Build the OAuth2Client with the provided properties of the builder.

public ValueTask<IOAuth2Client> BuildAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token for this method

Returns

ValueTask<IOAuth2Client>

Configured OAuth2Client

SetHttpClientHandler(HttpClientHandler)

Set custom HTTP Client handler for requests of the OAuth2 client.

public OAuth2ClientBuilder SetHttpClientHandler(HttpClientHandler handler)

Parameters

handler HttpClientHandler

Custom handler for HTTP requests

Returns

OAuth2ClientBuilder

SetScope(string)

Set the requested scopes for the client.

public OAuth2ClientBuilder SetScope(string scope)

Parameters

scope string

OAuth scopes to request from the Issuer

Returns

OAuth2ClientBuilder