You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/discord-social-sdk/development-guides/using-provisional-accounts.mdx
+43-16Lines changed: 43 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,17 +67,22 @@ For existing Discord users who have added a provisional account as a game friend
67
67
68
68
---
69
69
70
-
## Choosing an Authentication Method
70
+
## Getting Set Up
71
+
### Choosing an Authentication Method
71
72
72
-
Discord offers a number of authentication methods tailored to different games:
73
+
Discord offers a number of authentication methods, the one you use depends on how you game and account system is set up:
73
74
74
-
1. Use the [**Bot Token Endpoint**](/docs/discord-social-sdk/development-guides/using-provisional-acounts#bot-token-endpoint#) if your game has an account system which uniquely identifies users. This is the recommended approach when possible.
75
-
2. Use the [**External Credentials Exchange Endpoint**](/docs/discord-social-sdk/development-guides/using-provisional-acounts#external-credentials-exchange-endpoint) if you have an existing OIDC provider, or do not have an account system.
76
-
3. Use the [**Client Side Token Exchange Method**](/docs/discord-social-sdk/development-guides/using-provisional-acounts#provisional-account-authentication-for-public-clients) if you are using a Public Client.
75
+
1. Use the [Bot Token Endpoint](/docs/discord-social-sdk/development-guides/using-provisional-accounts#bot-token-endpoint#) if your game has an account system which uniquely identifies users. This is the recommended approach when possible.
76
+
2. Use the [External Credentials Exchange Endpoint](/docs/discord-social-sdk/development-guides/using-provisional-accounts#external-credentials-exchange-endpoint) if you have an existing OIDC provider, or do not have an account system.
77
+
3. Use the [Client Side Token Exchange Method](/docs/discord-social-sdk/development-guides/using-provisional-accounts#provisional-account-authentication-for-public-clients) if you are using a Public Client.
77
78
78
-
If you are using the **External Credentials Exchange Endpoint**or **Client Side Token Exchange Method**, you must [configure you identity provider](/docs/discord-social-sdk/development-guides/using-provisional-acounts#configuring-your-identity-provider) before proceeding.
79
+
If you are using (2) or (3), you must configure you identity provider before proceeding.
79
80
80
-
## Configuring Your Identity Provider
81
+
### Configuring Your Identity Provider
82
+
83
+
:::warn
84
+
If you are using the bot token endpoint, no configuration is required.
85
+
:::
81
86
82
87
Open the Discord app for your game in the [Developer Portal](https://discord.com/developers/applications). Find the `External Auth` page under the `Discord Social SDK` section in the sidebar.
83
88
@@ -90,9 +95,7 @@ We currently support the following provider types:
90
95
- Epic Online Services (EOS)
91
96
- Unity
92
97
93
-
If you are using the bot token endpoint, no configuration is required.
94
-
95
-
Which are represented in Discord's systems by the following types:
98
+
Providers are represented in Discord's systems by the following types:
96
99
97
100
#### External Auth Types
98
101
@@ -115,7 +118,7 @@ You provide external authentication and uniquely identifies the user, and Discor
115
118
116
119
- If there is no account associated with the identity, a new provisional account is created along with a new access token for the user.
117
120
- If there is a provisional account associated with the identity, an access token is returned.
118
-
- If there is an existing _full Discord account_ associated with the identity, the request is aborted (See [Error Handling](/docs/discord-social-sdk/development-guides/using-provisional-acounts#error-handling)).
121
+
- If there is an existing _full Discord account_ associated with the identity, the request is aborted (See [Error Handling](/docs/discord-social-sdk/development-guides/using-provisional-accounts#error-handling)).
119
122
120
123
Once authentication is complete, you can use the access token as you would a full Discord user's access token.
121
124
@@ -245,15 +248,14 @@ Common error codes and solutions for the server token exchange methods:
When a player wants to convert their provisional account to a full Discord account, we start a special version of the [access token request flow](/docs/discord-social-sdk/development-guides/account-linking-with-discord#requesting-access-tokens) where the provisional users external identity is included.
293
295
294
-
- If you have a backend, follow [Merging Provisional Accounts for Servers](/docs/discord-social-sdk/development-guides/using-provisional-acounts#merging-provisional-accounts-for-servers)
295
-
- If you do not have a backend, follow [Merging Provisional Accounts for Public Clients ](/docs/discord-social-sdk/development-guides/using-provisional-acounts#merging-provisional-accounts-for-public-clients)
296
+
- If you have a backend, follow [Merging Provisional Accounts for Servers](/docs/discord-social-sdk/development-guides/using-provisional-accounts#merging-provisional-accounts-for-servers)
297
+
- If you do not have a backend, follow [Merging Provisional Accounts for Public Clients ](/docs/discord-social-sdk/development-guides/using-provisional-accounts#merging-provisional-accounts-for-public-clients)
296
298
297
299
### Merging Provisional Accounts for Servers
298
300
301
+
Merging is as simple as including `external_auth_type` and `external_auth_token` in a request to `/oauth2/token`. Discord will look up the Provisional User associated with the provided identity and attempt to merge it in to the full Discord account that generated the provided `code`.
302
+
299
303
#### Desktop & Mobile
300
304
301
305
```python
@@ -304,7 +308,7 @@ import requests
304
308
API_ENDPOINT='https://discord.com/api/v10'
305
309
CLIENT_ID='332269999912132097'
306
310
CLIENT_SECRET='937it3ow87i4ery69876wqire'
307
-
EXTERNAL_AUTH_TYPE='OIDC'
311
+
EXTERNAL_AUTH_TYPE='OIDC'# See External Auth Types above
0 commit comments