Skip to content

/AWS1/IF_CNT=>GETFEDERATIONTOKEN()

About GetFederationToken

Supports SAML sign-in for Amazon Connect. Retrieves a token for federation. The token is for the Amazon Connect user which corresponds to the IAM credentials that were used to invoke this action.

For more information about how SAML sign-in works in Amazon Connect, see Configure SAML with IAM for Amazon Connect in the Amazon Connect Administrator Guide.

This API doesn't support root users. If you try to invoke GetFederationToken with root credentials, an error message similar to the following one appears:

Provided identity: Principal: .... User: .... cannot be used for federation with Amazon Connect

Method Signature

METHODS /AWS1/IF_CNT~GETFEDERATIONTOKEN
  IMPORTING
    !IV_INSTANCEID TYPE /AWS1/CNTINSTANCEID OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cntgetfedr8ntokenrsp
  RAISING
    /AWS1/CX_CNTDUPLICATERESRCEX
    /AWS1/CX_CNTINTERNALSERVICEEX
    /AWS1/CX_CNTINVALIDPARAMETEREX
    /AWS1/CX_CNTINVALIDREQUESTEX
    /AWS1/CX_CNTRESOURCENOTFOUNDEX
    /AWS1/CX_CNTUSERNOTFOUNDEX
    /AWS1/CX_CNTCLIENTEXC
    /AWS1/CX_CNTSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_instanceid TYPE /AWS1/CNTINSTANCEID /AWS1/CNTINSTANCEID

The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

RETURNING

oo_output TYPE REF TO /aws1/cl_cntgetfedr8ntokenrsp /AWS1/CL_CNTGETFEDR8NTOKENRSP

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->getfederationtoken( |string| ).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_credentials = lo_result->get_credentials( ).
  IF lo_credentials IS NOT INITIAL.
    lv_securitytoken = lo_credentials->get_accesstoken( ).
    lv_timestamp = lo_credentials->get_accesstokenexpiration( ).
    lv_securitytoken = lo_credentials->get_refreshtoken( ).
    lv_timestamp = lo_credentials->get_refreshtokenexpiration( ).
  ENDIF.
  lv_url = lo_result->get_signinurl( ).
  lv_arn = lo_result->get_userarn( ).
  lv_agentresourceid = lo_result->get_userid( ).
ENDIF.