Table of Contents

Class FluxerOAuthClient

Namespace
Fluxer.Net.OAuth
Assembly
Fluxer.Net.dll

OAuth client used for Fluxer.

public class FluxerOAuthClient : FluxerBaseClient
Inheritance
object
FluxerOAuthClient
Inherited Members

Constructors

FluxerOAuthClient(ulong, string, FluxerConfig?)

Create an OAuth client with id and secret then use access or refresh tokens.

public FluxerOAuthClient(ulong clientId, string clientSecret, FluxerConfig? config = null)

Parameters

clientId ulong
clientSecret string
config FluxerConfig

Exceptions

ArgumentNullException
ArgumentException

Properties

ClientId

Client id for the OAuth app.

public ulong ClientId { get; }

Property Value

ulong

ClientSecret

Client secret for the OAuth app.

public string ClientSecret { get; }

Property Value

string

Rest

Http client for Fluxer with requests.

public FluxerApiClient Rest { get; }

Property Value

FluxerApiClient

Methods

CheckValidTokenAsync(string)

Check if oauth token is valid.

public Task<bool> CheckValidTokenAsync(string accessToken)

Parameters

accessToken string

Returns

Task<bool>

ExchangeRefreshTokenAsync(string)

Get new access token from refresh token.

public Task<FluxerOAuthRefreshToken> ExchangeRefreshTokenAsync(string refreshToken)

Parameters

refreshToken string

Returns

Task<FluxerOAuthRefreshToken>

GetConnectionsAsync(string)

Get user connections from access token.

public Task<IEnumerable<UserConnection>> GetConnectionsAsync(string accessToken)

Parameters

accessToken string

Returns

Task<IEnumerable<UserConnection>>

GetGuildsAsync(string)

Get user guilds from access token.

public Task<IEnumerable<Guild>> GetGuildsAsync(string accessToken)

Parameters

accessToken string

Returns

Task<IEnumerable<Guild>>

GetTokenAsync(string)

Get oauth token from access token.

public Task<FluxerOAuthToken> GetTokenAsync(string accessToken)

Parameters

accessToken string

Returns

Task<FluxerOAuthToken>

GetUserAsync(string)

Get user from access token.

public Task<FluxerOAuthUser> GetUserAsync(string accessToken)

Parameters

accessToken string

Returns

Task<FluxerOAuthUser>

GetValidTokenAsync(string)

Check if oauth token is valid.

public Task<FluxerOAuthValidToken> GetValidTokenAsync(string accessToken)

Parameters

accessToken string

Returns

Task<FluxerOAuthValidToken>

RevokeAccessTokenAsync(string)

Remove access for access token.

public Task RevokeAccessTokenAsync(string accessToken)

Parameters

accessToken string

Returns

Task

RevokeRefreshTokenAsync(string)

Remove access for refresh token.

public Task RevokeRefreshTokenAsync(string refreshToken)

Parameters

refreshToken string

Returns

Task