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
Social SDK: Add OAuth Communications Scope warnings (#7653)
* Social SDK: Add OAuth Communications Scope warnings
Devs keep running into the issue that they aren't aware that to use
communication features, they need to enable communication OAuth scopes
(mainly because we're not explicit about it anywhere).
This aims to fix this! This PR includes:
- Reorganize core concepts page to prioritize OAuth scopes
- Add implementation details to OAuth guide
- Add warnings to guides using Communications features about scope
requirements
* Review updates.
The Social SDK provides the helper method [`Client::GetDefaultPresenceScopes`], which returns `openid sdk.social_layer_presence`,
114
+
that you can use when setting up your OAuth2 flow, for integrations that only need the above functionality.
115
+
116
+
:::warn
117
+
With only the default presence scopes, your game will not be able to use any of the limited access
118
+
communications features.
119
+
:::
120
+
121
+
### Default Communication Scopes
122
+
123
+
The communications features are currently available but have limited access. Those features **require** the scope
124
+
of `sdk.social_layer`, which includes the `sdk.social_layer_presence` scope but also allows your app to use those limited features on behalf of the user.
The Social SDK provides the helper method [`Client::GetDefaultCommunicationScopes`], which returns `openid sdk.social_layer`,
135
+
that you can use when setting up your OAuth2 flow, for integrations that integrates both the default and limited communications features.
136
+
137
+
:::preview
138
+
For more information about these features, please see [Core Concepts: Limited Access Features](/docs/discord-social-sdk/core-concepts#limited-access-features).
139
+
:::
140
+
141
+
If your game requires additional scopes, you can add them to the default scopes to authorize additional access from your users.
142
+
143
+
You should only add scopes that are necessary for your game to function. Requesting unnecessary scopes can lead to user distrust and may result in users not linking their Discord account.
144
+
145
+
See [available OAuth2 scopes](/docs/topics/oauth2#shared-resources-oauth2-scopes) available with the Discord API.
146
+
147
+
### OAuth2 Client Types
148
+
149
+
OAuth2 has two client types: **Public** and **Confidential**. Most games will not want to ship with **Public Client** enabled.
150
+
151
+
Some Social SDK methods require your Discord application to be a **Public Client**. These methods also have server-side alternatives that you can use with a **Confidential Client**.
152
+
153
+
- Public clients cannot securely store client secrets.
154
+
- Using confidential clients with proper secret management for production applications is generally recommended.
155
+
- Your security team should review this setting and authentication flows before releasing your game.
156
+
157
+
[Learn more about OAuth2 client types](https://oauth.net/2/client-types)
158
+
159
+
---
160
+
91
161
## Core Features
92
162
93
163
The Discord Social SDK offers a range of features to enhance social interactions within games. Developers can leverage these features to create a more engaging and connected experience for players in their game.
@@ -138,8 +208,8 @@ The SDK models friendships and relationships in two ways:
138
208
139
209
Users can communicate via direct messages (DMs) and voice calls:
140
210
141
-
- DMs: One-on-one private chat (`MessageHandle`).
142
-
- Calls: Real-time voice communication inside a game lobby (`Call`).
@@ -200,47 +270,6 @@ Games can link in-game chat with Discord's server-based text channels in their U
200
270
- Respect user privacy: Never send friend requests or messages without user consent.
201
271
- Design intuitive UI/UX: Ensure social features blend seamlessly with the gameplay.
202
272
203
-
### OAuth2 Scopes
204
-
205
-
OAuth2 scopes define the level of access your app has to a user's Discord account.
206
-
207
-
At a minimum, the Social SDK uses the following scopes to use features like rich presence and friends list:
208
-
209
-
-`openid`
210
-
-`sdk.social_layer_presence`
211
-
212
-
Some SDK features are currently available but have limited access. Those features require the following scope of `sdk.social_layer`, which includes the `sdk.social_layer_presence` scope but also allows your app to use those limited features on behalf of the user.
213
-
214
-
-`openid`
215
-
-`sdk.social_layer`
216
-
217
-
:::preview
218
-
For more information about these features, please see [Core Concepts: Limited Access Features](/docs/discord-social-sdk/core-concepts#limited-access-features).
219
-
:::
220
-
221
-
The Social SDK provides two helper methods that you can use when setting up your OAuth2 flow:
222
-
223
-
-[`Client::GetDefaultPresenceScopes`], which returns "openid sdk.social_layer_presence".
224
-
-[`Client::GetDefaultCommunicationScopes`], which returns "openid sdk.social_layer".
225
-
226
-
If your game requires additional scopes, you can add them to the default scopes to authorize additional access from your users.
227
-
228
-
You should only add scopes that are necessary for your game to function. Requesting unnecessary scopes can lead to user distrust and may result in users not linking their Discord account.
229
-
230
-
See [available OAuth2 scopes](/docs/topics/oauth2#shared-resources-oauth2-scopes) available with the Discord API.
231
-
232
-
### OAuth2 Client Types
233
-
234
-
OAuth2 has two client types: **Public** and **Confidential**. Most games will not want to ship with **Public Client** enabled.
235
-
236
-
Some Social SDK methods require your Discord application to be a **Public Client**. These methods also have server-side alternatives that you can use with a **Confidential Client**.
237
-
238
-
- Public clients cannot securely store client secrets.
239
-
- Using confidential clients with proper secret management for production applications is generally recommended.
240
-
- Your security team should review this setting and authentication flows before releasing your game.
241
-
242
-
[Learn more about OAuth2 client types](https://oauth.net/2/client-types)
243
-
244
273
### Design Guidelines
245
274
246
275
Check out the [Discord Social SDK Design Guidelines](/docs/discord-social-sdk/design-guidelines) for more best practices and common integration scenarios.
@@ -265,13 +294,18 @@ Learn more about [Using the Discord HTTP API](/docs/discord-social-sdk/developme
0 commit comments