OAuthUtil - Global
-
- UpdatedAug 3, 2023
- 1 minute read
- Vancouver
- API reference
This script include modifies request parameters and parses the token response during runtime.
If the external OAuth provider returns a response other than an application/JSON type response, you can customize your own version of this script include to parse responses that are in different format. Extend or copy this script include, and then reference your version from the OAuth API Script field on the Application Registry form for third-party OAuth providers. The custom script include name must start with OAuth.
OAuthUtil - getOAuthProfile()
Returns a GlideRecord representing the current OAuth profile
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
GlideRecord | GlideRecord representing the current OAuth profile |
OAuthUtil - interceptRequestParameters(requestParamMap)
Adds a name:value pair to the request parameters.
Name | Type | Description |
---|---|---|
requestParamMap | String | The name:value pair you want to add. |
Type | Description |
---|---|
void |
OAuthUtil - parseTokenResponse(accessTokenResponse)
Parses the token received into a parameter map.
Name | Type | Description |
---|---|---|
accessTokenResponse | String | The access token response that you want to parse. |
Type | Description |
---|---|
void |
OAuthUtil - setEndpoint(url)
Set the endpoiont for your OAuth request
Name | Type | Description |
---|---|---|
url | String | URL endpoint for your request |
Type | Description |
---|---|
void |
OAuthUtil - setHeader(headerName, headerValue)
Add a header to an outbound token request.
Name | Type | Description |
---|---|---|
headerName | String | Name of your token request header |
headerValue | String | Value of your token request header |
Type | Description |
---|---|
void |
OAuthUtil - setQueryParameter(paramName, paramValue)
Add a query parameter to an OAuth request.
Name | Type | Description |
---|---|---|
paramName | String | Name of your parameter |
paramValue | String | Value of your parameter |
Type | Description |
---|---|
void |