Skip to content

/AWS1/IF_CGP=>ADDUSERPOOLCLIENTSECRET()

About AddUserPoolClientSecret

Creates a new client secret for an existing confidential user pool app client. Supports up to 2 active secrets per app client for zero-downtime credential rotation workflows.

Method Signature

METHODS /AWS1/IF_CGP~ADDUSERPOOLCLIENTSECRET
  IMPORTING
    !IV_USERPOOLID TYPE /AWS1/CGPUSERPOOLIDTYPE OPTIONAL
    !IV_CLIENTID TYPE /AWS1/CGPCLIENTIDTYPE OPTIONAL
    !IV_CLIENTSECRET TYPE /AWS1/CGPCLIENTSECRETTYPE OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cgpadduserpoolclise01
  RAISING
    /AWS1/CX_CGPACCESSDENIEDEX
    /AWS1/CX_CGPINTERNALSERVEREX
    /AWS1/CX_CGPINVALIDPARAMETEREX
    /AWS1/CX_CGPLIMITEXCEEDEDEX
    /AWS1/CX_CGPRESOURCENOTFOUNDEX
    /AWS1/CX_CGPTOOMANYREQUESTSEX
    /AWS1/CX_CGPCLIENTEXC
    /AWS1/CX_CGPSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_userpoolid TYPE /AWS1/CGPUSERPOOLIDTYPE /AWS1/CGPUSERPOOLIDTYPE

The ID of the user pool that contains the app client.

iv_clientid TYPE /AWS1/CGPCLIENTIDTYPE /AWS1/CGPCLIENTIDTYPE

The ID of the app client for which you want to create a new secret.

Optional arguments:

iv_clientsecret TYPE /AWS1/CGPCLIENTSECRETTYPE /AWS1/CGPCLIENTSECRETTYPE

The client secret value you want to use. If you don't provide this parameter, Amazon Cognito generates a secure secret for you.

RETURNING

oo_output TYPE REF TO /aws1/cl_cgpadduserpoolclise01 /AWS1/CL_CGPADDUSERPOOLCLISE01

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->adduserpoolclientsecret(
  iv_clientid = |string|
  iv_clientsecret = |string|
  iv_userpoolid = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_clientsecretdescriptort = lo_result->get_clientsecretdescriptor( ).
  IF lo_clientsecretdescriptort IS NOT INITIAL.
    lv_clientsecretidtype = lo_clientsecretdescriptort->get_clientsecretid( ).
    lv_clientsecrettype = lo_clientsecretdescriptort->get_clientsecretvalue( ).
    lv_datetype = lo_clientsecretdescriptort->get_clientsecretcreatedate( ).
  ENDIF.
ENDIF.