Skip to content

Commit

Permalink
Document integration_type oauth parameter (discord#6738)
Browse files Browse the repository at this point in the history
* Document `integration_type` oauth parameter

* Update OAuth2.md

---------

Co-authored-by: Yoni Lerner <yonilerner@gmail.com>
  • Loading branch information
2 people authored and shaydewael committed May 14, 2024
1 parent 8bb8d20 commit 2f32ee1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/topics/OAuth2.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ All calls to the OAuth2 endpoints require either HTTP Basic authentication or `c
###### Authorization URL Example

```
https://discord.com/oauth2/authorize?response_type=code&client_id=157730590492196864&scope=identify%20guilds.join&state=15773059ghq9183habn&redirect_uri=https%3A%2F%2Fnicememe.website&prompt=consent
https://discord.com/oauth2/authorize?response_type=code&client_id=157730590492196864&scope=identify%20guilds.join&state=15773059ghq9183habn&redirect_uri=https%3A%2F%2Fnicememe.website&prompt=consent&integration_type=0
```

`client_id` is your application's `client_id`. `scope` is a list of [OAuth2 scopes](#DOCS_TOPICS_OAUTH2/shared-resources-oauth2-scopes) separated by url encoded spaces (`%20`). `redirect_uri` is whatever URL you registered when creating your application, url-encoded. `state` is the unique string mentioned in [State and Security](#DOCS_TOPICS_OAUTH2/state-and-security).
Expand All @@ -82,6 +82,8 @@ When someone navigates to this URL, they will be prompted to authorize your appl

`prompt` controls how the authorization flow handles existing authorizations. If a user has previously authorized your application with the requested scopes and prompt is set to `consent`, it will request them to reapprove their authorization. If set to `none`, it will skip the authorization screen and redirect them back to your redirect URI without requesting their authorization. For passthrough scopes, like `bot` and `webhook.incoming`, authorization is always required.

The `integration_type` parameter specifies the [installation context](#DOCS_RESOURCES_APPLICATION/installation-context) for the authorization. The installation context determines where the application will be installed, and is only relevant when `scope` contains `applications.commands`. When set to 0 (GUILD_INSTALL) the application will be authorized for installation to a server, and when set to 1 (USER_INSTALL) the application will be authorized for installation to a user. The application must be configured in the Developer Portal to support the provided `integration_type`.

###### Redirect URL Example

```
Expand Down

0 comments on commit 2f32ee1

Please sign in to comment.