/AWS1/IF_SSO=>GETROLECREDENTIALS()¶
About GetRoleCredentials¶
Returns the STS short-term credentials for a given role name that is assigned to the user.
Method Signature¶
METHODS /AWS1/IF_SSO~GETROLECREDENTIALS
IMPORTING
!IV_ROLENAME TYPE /AWS1/SSOROLENAMETYPE OPTIONAL
!IV_ACCOUNTID TYPE /AWS1/SSOACCOUNTIDTYPE OPTIONAL
!IV_ACCESSTOKEN TYPE /AWS1/SSOACCESSTOKENTYPE OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ssogetrolecredsrsp
RAISING
/AWS1/CX_SSOINVALIDREQUESTEX
/AWS1/CX_SSORESOURCENOTFOUNDEX
/AWS1/CX_SSOTOOMANYREQUESTSEX
/AWS1/CX_SSOUNAUTHORIZEDEX
/AWS1/CX_SSOCLIENTEXC
/AWS1/CX_SSOSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_rolename TYPE /AWS1/SSOROLENAMETYPE /AWS1/SSOROLENAMETYPE¶
The friendly name of the role that is assigned to the user.
iv_accountid TYPE /AWS1/SSOACCOUNTIDTYPE /AWS1/SSOACCOUNTIDTYPE¶
The identifier for the AWS account that is assigned to the user.
iv_accesstoken TYPE /AWS1/SSOACCESSTOKENTYPE /AWS1/SSOACCESSTOKENTYPE¶
The token issued by the
CreateTokenAPI call. For more information, see CreateToken in the IAM Identity Center OIDC API Reference Guide.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_ssogetrolecredsrsp /AWS1/CL_SSOGETROLECREDSRSP¶
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->getrolecredentials(
iv_accesstoken = |string|
iv_accountid = |string|
iv_rolename = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lo_rolecredentials = lo_result->get_rolecredentials( ).
IF lo_rolecredentials IS NOT INITIAL.
lv_accesskeytype = lo_rolecredentials->get_accesskeyid( ).
lv_secretaccesskeytype = lo_rolecredentials->get_secretaccesskey( ).
lv_sessiontokentype = lo_rolecredentials->get_sessiontoken( ).
lv_expirationtimestamptype = lo_rolecredentials->get_expiration( ).
ENDIF.
ENDIF.