OAuthAPI.GetOpenIDMetadata

Get metadata from the Identity Provider for a service running on a Genero Application Server (GAS).

Syntax

GetOpenIDMetadata()
RETURNS OAuthAPI.OpenIDMetadataType

NULL may be returned if metadata is not found.

Usage

Use this function to retrieve metadata (such as registration endpoint, supported scopes, user information endpoints, etc.) provided by the Genero Identity Provider for access to a secure RESTful Web service. A request is made to return the metadata and the information is stored in the OpenIDMetadataType record.

If the service is not started behind the GAS, call the FetchOpenIDMetadata() function instead.

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

OAuthAPI.GetOpenIDMetadata function

IMPORT FGL OAuthAPI

DEFINE metadata OAuthAPI.OpenIDMetadataType
DEFINE ind INTEGER

MAIN
  # ...
   CALL OAuthAPI.GetOpenIDMetadata() RETURNING metadata.*
   IF metadata.issuer IS NULL THEN
       ERROR "IdP not available"
   ELSE
     DISPLAY "Registration endpoint is:", metadata.registration_endpoint
     FOR ind = 1 TO metadata.scopes_supported.getLength()
       DISPLAY "Scope is: ", metadata.scopes_supported[ind]
     END FOR
   END IF
   # ... 
  
END MAIN