ExternalClientAppOauthHandler Class
Namespace
Usage
When you create an external client app, you specify general information about the app and settings for OAuth. To customize how the app is invoked, create a external client app handler with the ExternalClientAppOauthHandler Apex class. For example, use this class to support new authentication protocols or respond to user attributes in a way that benefits the business process.
When you create an external client app handler, you also configure the ExternalClientAppOauthHandler class to run as an execution user. The execution user authorizes access for the external client app. For example, when you use the authorize method, the execution user authorizes the external client app to access data.
If you don't specify an execution user, the plug-in runs as an Automated Process User, which is a system user that executes tasks behind the scenes. Most ExternalClientAppOauthHandler methods require that you specify an execution user, with the exception of the customAttributes method.
ExternalClientAppOauthHandler Methods
The following are methods for ExternalClientAppOauthHandler.
authorize(userId, ecAppId, isAdminApproved, context)
Signature
public Boolean authorize(Id userId, Id ecAppId, Boolean isAdminApproved, Auth.InvocationContext context)
Parameters
- userId
- Type: Id
- The 15-character ID of the user attempting to use the external client app.
- ecAppId
- Type: Id
- The 15-character ID of the external client app.
- isAdminApproved
- Type: Boolean
- The approval state of the specified user when the external client app requires approval.
- context
- Type: Auth.InvocationContext
- The context in which the external client app is invoked.
customAttributes(userId, ecAppId, formulaDefinedAttributes, context)
Signature
public Map<String,String> customAttributes(Id userId, Id ecAppId, Map<String,String> formulaDefinedAttributes, Auth.InvocationContext context)
Parameters
- userId
- Type: Id
- The 15-character ID of the user attempting to use the external client app.
- ecAppId
- Type: Id
- The 15-character ID for the external client app.
- formulaDefinedAttributes
- Type: Map<String,String>
- A map of the current set of attributes from the UserInfo endpoint (OAuth) or from a SAML assertion. For more information, see The UserInfo Endpoint in the online help.
- context
- Type: Auth.InvocationContext
- The context in which the external client app is invoked.