Skip to content

/AWS1/CL_CGI=>GETOPENIDTOKEN()

About GetOpenIdToken

Gets an OpenID token, using a known Cognito ID. This known Cognito ID is returned by GetId. You can optionally add additional logins for the identity. Supplying multiple logins creates an implicit link.

The OpenID token is valid for 10 minutes.

This is a public API. You do not need any credentials to call this API.

Method Signature

IMPORTING

Required arguments:

iv_identityid TYPE /AWS1/CGIIDENTITYID /AWS1/CGIIDENTITYID

A unique identifier in the format REGION:GUID.

Optional arguments:

it_logins TYPE /AWS1/CL_CGILOGINSMAP_W=>TT_LOGINSMAP TT_LOGINSMAP

A set of optional name-value pairs that map provider names to provider tokens. When using graph.facebook.com and www.amazon.com, supply the access_token returned from the provider's authflow. For accounts.google.com, an Amazon Cognito user pool provider, or any other OpenID Connect provider, always include the id_token.

RETURNING

oo_output TYPE REF TO /aws1/cl_cgigetopenidtokenrsp /AWS1/CL_CGIGETOPENIDTOKENRSP

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->/aws1/if_cgi~getopenidtoken(
  it_logins = VALUE /aws1/cl_cgiloginsmap_w=>tt_loginsmap(
    (
      VALUE /aws1/cl_cgiloginsmap_w=>ts_loginsmap_maprow(
        key = |string|
        value = new /aws1/cl_cgiloginsmap_w( |string| )
      )
    )
  )
  iv_identityid = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_identityid = lo_result->get_identityid( ).
  lv_oidctoken = lo_result->get_token( ).
ENDIF.