OAuthAPI.GetIdRoles

Get OAuth ID Token authorization roles.

Syntax

GetIdRoles()
RETURNS DYNAMIC ARRAY OF STRING

Usage

Use this function to get the list of authorization OAuth 2.0 roles that the Identity Provider securing the RESTful web service supports. IdP role information can be retrieved from the GWS engine once it has been initialized by OAuthAPI.init.

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

OAuthAPI.GetIdRoles function

IMPORT FGL OAuthAPI

MAIN

DEFINE ind INTEGER
DEFINE roles DYNAMIC ARRAY OF STRING

# ...
   IF NOT OAuthAPI.init(5, "AF350CBC-8801-4DFB-9A78-A95B25BB32AF", "8JEq3HBfxrmj/8vMP66iaRQnGrWVyjqr" ) THEN
      MESSAGE "Error: unable to initialize OAuth"
      EXIT PROGRAM 1
   ELSE
      LET roles = OAuthAPI.GetIdRoles()
      FOR ind = 1 TO roles.getLength()
        DISPLAY "Role supported is: ", roles[ind]
      END FOR
   END IF
   # ... 
  
END MAIN