Ways to use scopes
When an app requests permission to access a resource through an , it uses thescope
parameter to specify what access it needs, and the authorization server uses the scope
parameter to respond with the access that was actually granted (if the granted access was different from what was requested).
Generally, you use scopes in three ways:
- From an application, to verify the identity of a user and get basic profile information about the user, such as their email or picture. In this scenario, the scopes available to you include those implemented by the Connect (OIDC) protocol. To learn more, read OpenID Connect Scopes.
- In an API, to implement access control. In this case, you need to define custom scopes for your API and then identify these scopes so that calling applications can use them. To learn more, read API Scopes.
- From an application, to call an API that has implemented its own custom scopes. In this case, you need to know which custom scopes are defined for the API you are calling. To see examples of calling a custom API from an application, read Sample Use Cases: Scopes and Claims