Implementing User Auth with OAuth 2
How to Implement User Auth with OAuth 2#
Rollout can authenticate users within your app using OAuth 2.0 which you can implement by following the steps below:
Step 1: Setup#
Go to the User Auth page in the Rollout dashboard and Select the OAuth 2.0
option.
Step 2: Add the Redirect URL to your allow list (Optional)#
You may need to add Rollout's OAuth redirect URL to your allowed domains list. Add the following URL to your allowed domains list: https://api.rollouthq.com/oauth/redirect
Step 3: Add Application Credentials#
Configure the credentials used to exchange a code for token information.
Key | Required |
---|---|
CLIENT_ID | ✅ |
CLIENT_SECRET | ✅ |
Step 4: Configure OAuth 2.0 Endpoints#
Authentication Endpoint#
This is where users should be sent to initiate the authentication flow.
In order for Rollout to successfully process the redirection, the following query parameter values are required:
key | value | required |
---|---|---|
state | {{context.inputData.state}} | ✅ |
redirect_uri | {{context.inputData.redirect_uri}} | ✅ |
Once a user authenticates successfully and the authorization server generates an exchange code, redirect them to the redirect_uri
value with the state
and code
as query parameters.
If using Code Mode, the expected return value is a string.
Access Token Request#
Configure the HTTP Request which Rollout will use to exchange the code
from the Authentication Request for token information.
The received object will be available from here on in future execution contexts (such as REST hook subscriptions, or Action invocations) in the {{context.authData}}
object.
Refresh Token Request#
This Schema will be used when retrieving fresh token information when existing tokens (e.g. refresh_token
) are already present.