OAuth Component

The OAuth component is used to configure a Gear for authentication of outgoing HTTP network requests to services using the OAuth 2.0 standard. Configuration can be exposed to the Gear end user using the GearLifecycle component allowing them to fill out credentials using a web form. After it is configured, the OAuth component can be referenced in calls to the HTTP service to authenticate requests.

Typically, you need to configure the remote system to accept Personalization for OAuth requests. When prompted for an OAuth callback or redirect URL, supply the following:

It is a best practice to provide a Gear configuration page that explains how a user installing your Gear has to configure OAuth in any connected systems. Remember to show them the proper callback URL and provide direct links into the remote platform for where the Personalization OAuth app can be configured.

Example

OAuthExample.ts

Expose the authentication options to end users using the Gear Lifecycle component.

Example

GearLifecycle.ts

The following screenshot is an example of how the resulting configuration page looks like with the OAuthComponent exposed on the lifecycle.

OAuth Config