An external client app can use the OAuth authorization protocol to access protected
resources. As part of the protocol, OAuth default scopes fine-tune the app’s permissions to
access protected resources in Salesforce. However, these default scopes are insufficient when an
external entity hosts the protected resource. In this scenario, Salesforce plays the role of
OAuth authentication and authorization provider, but it has little knowledge about the resource
it’s protecting. To define an external client app’s permissions to access protected resources
hosted by an external entity, create an OAuth custom scope. The custom scope tells the external
entity which information the external client app is authorized to access.
Required Editions
| Available in: both Salesforce Classic
and Lightning Experience |
|
External client apps can be created in: Group, Essentials,
Professional, Enterprise, Performance, Unlimited, and
Developer Editions
External client apps can be installed in: All
editions
|
Typically, to receive custom scopes that are assigned to an
external client app, you must include the scope parameter in the
authorization request. With the OAuth 2.0 JWT bearer flow, for external client apps that are
pre-authorized, custom scopes are automatically returned with an access token. For more
information, see OAuth 2.0 JWT Bearer Flow for Server-to-Server Integration.
- Create an OAuth Custom Scope
To define permissions about the data that an external client app can access from an external entity, create an OAuth custom scope in Salesforce. The custom scope tells the external entity which information the external client app is authorized to access.
- Assign an OAuth Custom Scope to a Connected App
After you create an OAuth custom scope in your Salesforce org, you can assign it to an external client app to set data-access permissions for the app. For example, an external client app with an order_status custom scope has the correct permission set to access order status data from the external entity.
- Edit an OAuth Custom Scope
You can change the name and description of a custom scope, and update your selection to include the custom scope in the OpenID Connect discovery endpoint.