OAuthUtil - Global

  • リリースバージョン: Australia
  • 更新日 2026年03月12日
  • 所要時間:3分
  • 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");
    },

    OAuthUtil - getOAuthProfile()

    Returns a GlideRecord representing the current OAuth profile

    表 : 1. Parameters
    Name Type Description
    None
    表 : 2. Returns
    Type Description
    GlideRecord GlideRecord representing the current OAuth profile

    OAuthUtil - interceptRequestParameters(requestParamMap)

    Adds a name:value pair to the request parameters.

    表 : 3. Parameters
    Name Type Description
    requestParamMap String The name:value pair you want to add.
    表 : 4. Returns
    Type Description
    void

    OAuthUtil - parseTokenResponse(accessTokenResponse)

    Parses the token received into a parameter map.

    表 : 5. Parameters
    Name Type Description
    accessTokenResponse String The access token response that you want to parse.
    表 : 6. Returns
    Type Description
    void

    OAuthUtil - setEndpoint(url)

    Set the endpoiont for your OAuth request

    表 : 7. Parameters
    Name Type Description
    url String URL endpoint for your request
    表 : 8. Returns
    Type Description
    void

    OAuthUtil - setHeader(headerName, headerValue)

    Add a header to an outbound token request.

    表 : 9. Parameters
    Name Type Description
    headerName String Name of your token request header
    headerValue String Value of your token request header
    表 : 10. Returns
    Type Description
    void

    OAuthUtil - setQueryParameter(paramName, paramValue)

    Add a query parameter to an OAuth request.

    表 : 11. Parameters
    Name Type Description
    paramName String Name of your parameter
    paramValue String Value of your parameter
    表 : 12. Returns
    Type Description
    void