Skip to content

/AWS1/IF_STS=>GETDELEGATEDACCESSTOKEN()

About GetDelegatedAccessToken

Exchanges a trade-in token for temporary Amazon Web Services credentials with the permissions associated with the assumed principal. This operation allows you to obtain credentials for a specific principal based on a trade-in token, enabling delegation of access to Amazon Web Services resources.

Method Signature

METHODS /AWS1/IF_STS~GETDELEGATEDACCESSTOKEN
  IMPORTING
    !IV_TRADEINTOKEN TYPE /AWS1/STSTRADEINTOKENTYPE OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_stsgetdelegatedacct01
  RAISING
    /AWS1/CX_STSEXPDTRADEINTOKENEX
    /AWS1/CX_STSPACKEDPLYTOOLARG00
    /AWS1/CX_STSREGIONDISABLEDEX
    /AWS1/CX_STSCLIENTEXC
    /AWS1/CX_STSSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_tradeintoken TYPE /AWS1/STSTRADEINTOKENTYPE /AWS1/STSTRADEINTOKENTYPE

The token to exchange for temporary Amazon Web Services credentials. This token must be valid and unexpired at the time of the request.

RETURNING

oo_output TYPE REF TO /aws1/cl_stsgetdelegatedacct01 /AWS1/CL_STSGETDELEGATEDACCT01

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->getdelegatedaccesstoken( |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_accesskeyidtype = lo_credentials->get_accesskeyid( ).
    lv_accesskeysecrettype = lo_credentials->get_secretaccesskey( ).
    lv_tokentype = lo_credentials->get_sessiontoken( ).
    lv_datetype = lo_credentials->get_expiration( ).
  ENDIF.
  lv_nonnegativeintegertype = lo_result->get_packedpolicysize( ).
  lv_arntype = lo_result->get_assumedprincipal( ).
ENDIF.