OAuthAPI.GetMyAccessToken

Get a valid access token.

Syntax

GetMyAccessToken()
RETURNS STRING

NULL may be returned if the access token is not found or can not be renewed.

Usage

Use this function to retrieve the access token provided by the Identity Provider for access to a secure RESTful Web service. IdP token information is retrieved from the GWS engine once it has been initialized by OAuthAPI.init. If the access token has expired, a new token is requested (if a refresh token is available) and returned.

In case of error, a NULL value will be returned.

OAuthAPI.GetMyAccessToken function

IMPORT FGL OAuthAPI

DEFINE access_token STRING

MAIN
   IF NOT OAuthAPI.init(5, "AF350CBC-8801-4DFB-9A78-A95B25BB32AF", "8JEq3HBfxrmj/8vMP66iaRQnGrWVyjqr" ) THEN
      MESSAGE "Error: unable to initialize OAuth"
      EXIT PROGRAM 1
   ELSE
      LET access_token = OAuthAPI.GetMyAccessToken()
   END IF
   # ... 
  
END MAIN