Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

OAuthUtil- Global

The OAuthUtil 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.

For example, if the OAuth provider requires a resource parameter with value https://outlook.office365.com, the code would look like:

preprocessAccessToken: function(requestParamMap) {
  requestParamMap.put("resource", "https://outlook.office365.com");
},

Parent Topic:Server API reference

OAuthUtil - getOAuthProfile()

Returns a GlideRecord representing the current OAuth profile

NameTypeDescription
None  
TypeDescription
GlideRecordGlideRecord representing the current OAuth profile

OAuthUtil - interceptRequestParameters(requestParamMap)

Adds a name:value pair to the request parameters.

NameTypeDescription
requestParamMapStringThe name:value pair you want to add.
TypeDescription
void 

OAuthUtil - parseTokenResponse(accessTokenResponse)

Parses the token received into a parameter map.

NameTypeDescription
accessTokenResponseStringThe access token response that you want to parse.
TypeDescription
void 

OAuthUtil - setEndpoint(url)

Set the endpoiont for your OAuth request

NameTypeDescription
urlStringURL endpoint for your request
TypeDescription
void 

OAuthUtil - setHeader(headerName, headerValue)

Add a header to an outbound token request.

NameTypeDescription
headerNameStringName of your token request header
headerValueStringValue of your token request header
TypeDescription
void 

OAuthUtil - setQueryParameter(paramName, paramValue)

Add a query parameter to an OAuth request.

NameTypeDescription
paramNameStringName of your parameter
paramValueStringValue of your parameter
TypeDescription
void