Skip to content

Document limiting client access to scopes in Passport #8979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions passport.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
- [Assigning Scopes To Tokens](#assigning-scopes-to-tokens)
- [Checking Scopes](#checking-scopes)
- [Consuming Your API With JavaScript](#consuming-your-api-with-javascript)
- [Limiting access to certain scopes](#limiting-access-to-certain-scopes)
- [Events](#events)
- [Testing](#testing)

Expand Down Expand Up @@ -1169,6 +1170,16 @@ When using this method of authentication, you will need to ensure a valid CSRF t
> **Note**
> If you choose to send the `X-CSRF-TOKEN` header instead of `X-XSRF-TOKEN`, you will need to use the unencrypted token provided by `csrf_token()`.

<a name="limiting-access-to-certain-scopes"></a>
## Limiting access to certain scopes

Passport allows you to limit which clients request certain scopes from your users, this feature is off by default.

To enable it you will need to create a migration that adds a `scopes` column to your `oauth_clients` table, the column must be able to store a JSON array of permitted scopes. Everytime a user authorizes a client, Passport will check if the scope if present on the client.

> **Warning**
> This feature does not affect previously granted access tokens, if you take a scope away from a client you should revoke all of its active tokens!

<a name="events"></a>
## Events

Expand Down