Skip to content

/AWS1/IF_BDO=>CREATEOAUTH2CREDPROVIDER()

About CreateOauth2CredentialProvider

Creates a new OAuth2 credential provider.

Method Signature

IMPORTING

Required arguments:

iv_name TYPE /AWS1/BDOCREDPROVIDERNAME /AWS1/BDOCREDPROVIDERNAME

The name of the OAuth2 credential provider. The name must be unique within your account.

iv_credentialprovidervendor TYPE /AWS1/BDOCREDPVDRVENDORTYPE /AWS1/BDOCREDPVDRVENDORTYPE

The vendor of the OAuth2 credential provider. This specifies which OAuth2 implementation to use.

io_oauth2providerconfiginput TYPE REF TO /AWS1/CL_BDOOAUTH2PVDRCFGINPUT /AWS1/CL_BDOOAUTH2PVDRCFGINPUT

The configuration settings for the OAuth2 provider, including client ID, client secret, and other vendor-specific settings.

RETURNING

oo_output TYPE REF TO /aws1/cl_bdocreo2credpvdrrsp /AWS1/CL_BDOCREO2CREDPVDRRSP

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_bdo~createoauth2credprovider(
  io_oauth2providerconfiginput = new /aws1/cl_bdooauth2pvdrcfginput(
    io_customoauth2pvdrconfig = new /aws1/cl_bdocusto2pvdrcfginput(
      io_oauthdiscovery = new /aws1/cl_bdooauth2discovery(
        io_authservermetadata = new /aws1/cl_bdooauth2authsrvmet(
          it_responsetypes = VALUE /aws1/cl_bdoresponselisttype_w=>tt_responselisttype(
            ( new /aws1/cl_bdoresponselisttype_w( |string| ) )
          )
          iv_authorizationendpoint = |string|
          iv_issuer = |string|
          iv_tokenendpoint = |string|
        )
        iv_discoveryurl = |string|
      )
      iv_clientid = |string|
      iv_clientsecret = |string|
    )
    io_githuboauth2pvdrconfig = new /aws1/cl_bdogito2pvdrcfginput(
      iv_clientid = |string|
      iv_clientsecret = |string|
    )
    io_googleoauth2pvdrconfig = new /aws1/cl_bdogoogo2pvdrcfginput(
      iv_clientid = |string|
      iv_clientsecret = |string|
    )
    io_msftoauth2providerconfig = new /aws1/cl_bdomsfto2pvdrcfginput(
      iv_clientid = |string|
      iv_clientsecret = |string|
    )
    io_sforceoauth2pvdrconfig = new /aws1/cl_bdosforceo2pvdrcfginp(
      iv_clientid = |string|
      iv_clientsecret = |string|
    )
    io_slackoauth2providerconfig = new /aws1/cl_bdoslacko2pvdrcfginp(
      iv_clientid = |string|
      iv_clientsecret = |string|
    )
  )
  iv_credentialprovidervendor = |string|
  iv_name = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_secret = lo_result->get_clientsecretarn( ).
  IF lo_secret IS NOT INITIAL.
    lv_secretarn = lo_secret->get_secretarn( ).
  ENDIF.
  lv_credentialprovidername = lo_result->get_name( ).
  lv_credentialproviderarnty = lo_result->get_credentialproviderarn( ).
ENDIF.