Rise
The Vieneo Province
Loading...
Searching...
No Matches
discordpp::AuthorizationArgs Class Reference

Arguments to the Client::Authorize function. More...

#include <discordpp.h>

Collaboration diagram for discordpp::AuthorizationArgs:
[legend]

Public Member Functions

 AuthorizationArgs (AuthorizationArgs &&other) noexcept
 Move constructor for AuthorizationArgs.
AuthorizationArgs & operator= (AuthorizationArgs &&other) noexcept
 Move assignment operator for AuthorizationArgs.
 operator bool () const
 Returns true if the instance contains a valid object.
 AuthorizationArgs (const AuthorizationArgs &arg0)
 Copy constructor for AuthorizationArgs.
AuthorizationArgs & operator= (const AuthorizationArgs &arg0)
 Copy assignment operator for AuthorizationArgs.
 AuthorizationArgs ()
uint64_t ClientId () const
 Optional. The Discord application ID for your game. Defaults to the value set by Client::SetApplicationId.
void SetClientId (uint64_t ClientId)
 Setter for AuthorizationArgs::ClientId.
std::string Scopes () const
 Scopes is a space separated string of the oauth scopes your game is requesting.
void SetScopes (std::string Scopes)
 Setter for AuthorizationArgs::Scopes.
std::optional< std::string > State () const
 See https://discord.com/developers/docs/topics/oauth2#state-and-security for details on this field.
void SetState (std::optional< std::string > State)
 Setter for AuthorizationArgs::State.
std::optional< std::string > Nonce () const
 The nonce field is generally only useful for backend integrations using ID tokens.
void SetNonce (std::optional< std::string > Nonce)
 Setter for AuthorizationArgs::Nonce.
std::optional< discordpp::AuthorizationCodeChallenge > CodeChallenge () const
 If using the Client::GetToken flow, you will need to generate a code challenge and verifier.
void SetCodeChallenge (std::optional< discordpp::AuthorizationCodeChallenge > CodeChallenge)
 Setter for AuthorizationArgs::CodeChallenge.
std::optional< discordpp::IntegrationType > IntegrationType () const
 The type of integration the app will be installed as.
void SetIntegrationType (std::optional< discordpp::IntegrationType > IntegrationTypeIntegrationType)
 Setter for AuthorizationArgs::IntegrationType.
std::optional< std::string > CustomSchemeParam () const
 Custom URI scheme for mobile redirects.
void SetCustomSchemeParam (std::optional< std::string > CustomSchemeParam)
 Setter for AuthorizationArgs::CustomSchemeParam.

Static Public Attributes

static const AuthorizationArgs nullobj
 Uninitialized instance of AuthorizationArgs.

Detailed Description

Arguments to the Client::Authorize function.

Definition at line 1640 of file discordpp.h.

Constructor & Destructor Documentation

◆ AuthorizationArgs() [1/3]

discordpp::AuthorizationArgs::AuthorizationArgs ( AuthorizationArgs && other)
noexcept

Move constructor for AuthorizationArgs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AuthorizationArgs() [2/3]

discordpp::AuthorizationArgs::AuthorizationArgs ( const AuthorizationArgs & arg0)

Copy constructor for AuthorizationArgs.

Here is the call graph for this function:

◆ AuthorizationArgs() [3/3]

discordpp::AuthorizationArgs::AuthorizationArgs ( )
explicit

Member Function Documentation

◆ ClientId()

uint64_t discordpp::AuthorizationArgs::ClientId ( ) const

Optional. The Discord application ID for your game. Defaults to the value set by Client::SetApplicationId.

Here is the caller graph for this function:

◆ CodeChallenge()

std::optional< discordpp::AuthorizationCodeChallenge > discordpp::AuthorizationArgs::CodeChallenge ( ) const

If using the Client::GetToken flow, you will need to generate a code challenge and verifier.

Use Client::CreateAuthorizationCodeVerifier to generate these values and pass the challenge property here.

Here is the caller graph for this function:

◆ CustomSchemeParam()

std::optional< std::string > discordpp::AuthorizationArgs::CustomSchemeParam ( ) const

Custom URI scheme for mobile redirects.

This allows games to specify a completely custom URI scheme for OAuth redirects. For example, setting this to "mygame" will result in a URI scheme like: mygame:/authorize/callback

If not provided, defaults to the standard Discord format: discord-123456789:/authorize/callback

This is particularly useful for distinguishing between multiple games from the same developer or for avoiding conflicts with other apps.

Here is the caller graph for this function:

◆ IntegrationType()

std::optional< discordpp::IntegrationType > discordpp::AuthorizationArgs::IntegrationType ( ) const

The type of integration the app will be installed as.

https://discord.com/developers/docs/resources/application#installation-context

Here is the caller graph for this function:

◆ Nonce()

std::optional< std::string > discordpp::AuthorizationArgs::Nonce ( ) const

The nonce field is generally only useful for backend integrations using ID tokens.

For more information, see: https://openid.net/specs/openid-connect-core-1_0.html#rfc.section.2~nonce:~:text=auth_time%20response%20parameter.)-,nonce,-String%20value%20used

Here is the caller graph for this function:

◆ operator bool()

discordpp::AuthorizationArgs::operator bool ( ) const
inline

Returns true if the instance contains a valid object.

Definition at line 1661 of file discordpp.h.

◆ operator=() [1/2]

AuthorizationArgs & discordpp::AuthorizationArgs::operator= ( AuthorizationArgs && other)
noexcept

Move assignment operator for AuthorizationArgs.

Here is the call graph for this function:

◆ operator=() [2/2]

AuthorizationArgs & discordpp::AuthorizationArgs::operator= ( const AuthorizationArgs & arg0)

Copy assignment operator for AuthorizationArgs.

Here is the call graph for this function:

◆ Scopes()

std::string discordpp::AuthorizationArgs::Scopes ( ) const

Scopes is a space separated string of the oauth scopes your game is requesting.

Most games should just pass in Client::GetDefaultCommunicationScopes or Client::GetDefaultPresenceScopes which will include these scopes, respectively: openid sdk.social_layer or openid sdk.social_layer_presence

sdk.social_layer and sdk.social_layer_presence automatically expand to include all the necessary scopes for the integration.

You can pass in additional scopes if you need to, but as a general rule you should only request the scopes you actually need, and the user will need to grant access to those additional scopes as well.

Here is the caller graph for this function:

◆ SetClientId()

void discordpp::AuthorizationArgs::SetClientId ( uint64_t ClientId)

Setter for AuthorizationArgs::ClientId.

Here is the call graph for this function:

◆ SetCodeChallenge()

void discordpp::AuthorizationArgs::SetCodeChallenge ( std::optional< discordpp::AuthorizationCodeChallenge > CodeChallenge)

Setter for AuthorizationArgs::CodeChallenge.

Here is the call graph for this function:

◆ SetCustomSchemeParam()

void discordpp::AuthorizationArgs::SetCustomSchemeParam ( std::optional< std::string > CustomSchemeParam)

Setter for AuthorizationArgs::CustomSchemeParam.

Here is the call graph for this function:

◆ SetIntegrationType()

void discordpp::AuthorizationArgs::SetIntegrationType ( std::optional< discordpp::IntegrationType > IntegrationType)

Setter for AuthorizationArgs::IntegrationType.

Here is the call graph for this function:

◆ SetNonce()

void discordpp::AuthorizationArgs::SetNonce ( std::optional< std::string > Nonce)

Setter for AuthorizationArgs::Nonce.

Here is the call graph for this function:

◆ SetScopes()

void discordpp::AuthorizationArgs::SetScopes ( std::string Scopes)

Setter for AuthorizationArgs::Scopes.

Here is the call graph for this function:

◆ SetState()

void discordpp::AuthorizationArgs::SetState ( std::optional< std::string > State)

Setter for AuthorizationArgs::State.

Here is the call graph for this function:

◆ State()

std::optional< std::string > discordpp::AuthorizationArgs::State ( ) const

See https://discord.com/developers/docs/topics/oauth2#state-and-security for details on this field.

We recommend leaving this unset, and the SDK will automatically generate a secure random value for you.

Here is the caller graph for this function:

Member Data Documentation

◆ nullobj

const AuthorizationArgs discordpp::AuthorizationArgs::nullobj
static

Uninitialized instance of AuthorizationArgs.

Definition at line 1659 of file discordpp.h.


The documentation for this class was generated from the following file: