Discord Social SDK
|
Arguments to the Client::Authorize function.
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. | |
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. | |
Static Public Attributes | |
static const AuthorizationArgs | nullobj |
Uninitialized instance of AuthorizationArgs. | |
|
noexcept |
Move constructor for AuthorizationArgs.
discordpp::AuthorizationArgs::AuthorizationArgs | ( | const AuthorizationArgs & | arg0 | ) |
Copy constructor for AuthorizationArgs.
uint64_t discordpp::AuthorizationArgs::ClientId | ( | ) | const |
Optional. The Discord application ID for your game. Defaults to the value set by Client::SetApplicationId.
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.
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
|
inline |
Returns true if the instance contains a valid object.
|
noexcept |
Move assignment operator for AuthorizationArgs.
AuthorizationArgs & discordpp::AuthorizationArgs::operator= | ( | const AuthorizationArgs & | arg0 | ) |
Copy assignment operator for AuthorizationArgs.
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.
void discordpp::AuthorizationArgs::SetClientId | ( | uint64_t | ClientId | ) |
Setter for AuthorizationArgs::ClientId.
void discordpp::AuthorizationArgs::SetCodeChallenge | ( | std::optional< discordpp::AuthorizationCodeChallenge > | CodeChallenge | ) |
Setter for AuthorizationArgs::CodeChallenge.
void discordpp::AuthorizationArgs::SetNonce | ( | std::optional< std::string > | Nonce | ) |
Setter for AuthorizationArgs::Nonce.
void discordpp::AuthorizationArgs::SetScopes | ( | std::string | Scopes | ) |
Setter for AuthorizationArgs::Scopes.
void discordpp::AuthorizationArgs::SetState | ( | std::optional< std::string > | State | ) |
Setter for AuthorizationArgs::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.
|
static |
Uninitialized instance of AuthorizationArgs.