Show TOC

Creating BAdI Implementations for New Service Provider TypeLocate this document in the navigation structure

To implement a BAdI for the new service provider type, implement a new class that inherits from the superclass CL_OA2C_SPECIFICS_ABSTRACT containing the default OAuth 2.0 service provider specific settings.


In the newly created class, you can adjust the OAuth 2.0 client to the specific OAuth 2.0 implementation of your service provider. Your new class inherits a set of methods you can use as templates. You can change these methods to add parameters, values, and other options. Edit these methods and add service provider specific parameters, values, and other options by overwriting the inherited default OAuth 2.0 client settings with parameters required by your service provider.

In general, there are methods used to define all parameters sent to the service provider. By redefining these methods, you can overwrite any particular request/response parameter. You can use these methods, for example, to access token requests and responses, to extend the configuration to send the current values, or for scope separators. It is also possible to build views with various value sets you can use for different purposes.


  1. Open SAP GUI and start Class Builder (transaction SE24).
  2. Enter the object type for your new class, for example, ZCL_OA2C_SPECIFICS_Z<service_provider_type>, choose Create, and enter a description.
  3. Choose Usual ABAP Class and save. If you want to transport the class, save it in a transport request.
  4. Go to the Properties tab. This displays your new class with the details.
  5. Choose the Superclass pushbutton.
  6. Go to the Methods tab. This displays all the methods inherited from the default OAuth 2.0 client settings (superclass CL_OA2C_SPECIFICS_ABSTRACT).

  7. Example The following steps provide an example that is intended to give you an idea of how you can configure a set of additional settings and parameters.
    1. To redefine the endpoint setting, select the method IF_OA2C_SPECIFICS~GET_ENDPOINT_SETTINGS and choose (Redefine).
    2. Enter the appropriate code and replace the paths of the authorization endpoint, the token endpoint, and/or the revocation endpoint according to the requirements of your service provider.
    3. To redefine the extension setting, select the method IF_OA2C_SPECIFICS~GET_CONFIG_EXTENSION and choose (Redefine).
    4. Enter your service provider type.
    5. To add parameters to the setting, select the method IF_OA2C_SPECIFICS~GET_ADD_PARAMS and choose (Redefine).
    6. Replace the parameters according to the requirements of your service provider.
    7. To redefine the token request parameters of the authorization code flow, select the method IF_OA2C_SPECIFICS~GET_AC_AUTH_REQU_PARAM_NAMES and choose (Redefine).
    8. Replace the parameters according to the requirements of your service provider.
  8. Activate the class ZCL_OA2C_SPECIFICS_Z<service_provider_type>.
    You have now implemented the class with the parameters for your service provider. Its methods include the endpoint settings and the parameters that are required by the service provider.