Minimum requirements are SAP_BASIS 7.40 SP02 & SAP_GWFND 7.40 SP02 for using OAuth 2.0 authorization code grant type.
For using OAuth 2.0 authroization code grant type, an OAuth 2.0 Client must be registered in the AS ABAP and configured with the corresponding authentication method. Two steps will be executed there. Firstly a service user needs to be created. It is required to execute e.g. Access Token requests. Secondly the required OAuth 2.0 Client data needs to be defined. In this example, how to configure one OAuth 2.0 client LEAVEAPP is demonstrated.
Table of Contents:
Create a service user for the OAuth 2.0 Client
The OAuth 2.0 Client ID must be identical with the username the OAuth 2.0 client uses for login when requesting an Access Token. Therefore as a prerequisite a user with the name LEAVEAPP must exist in the system that will be used by the Leave-Request-Application client.
1. Start transaction SU01 |
|
2. Make sure that the tab Address is selected and enter a last name, e.g. LEAVEAPP. |
|
3. Switch to the tab Logon Data and choose User Type System. |
|
4. In the Password section choose Generate. |
|
5. The system will generate a password for the user and display it in the message section. |
|
6. As last step of the OAuth 2.0 Client's service user configuration choose Save. |
As a result the OAuth 2.0 Client's service user is completely configured.
Register the new OAuth 2.0 Client ID with the creation wizard
To register a new OAuth 2.0 client start transaction SOAUTH2. The transaction will display an overview about the OAuth 2.0 clients that were already registered. Choose Create to start the wizard for the new leave request application client LEAVEAPP.
1. On the first wizard screen enter LEAVEAPP in the field OAuth 2.0 Client ID. This identifier must be identical to the name of the service user created in the prerequisite step. |
|
2. Enter a short Description for this OAuth 2.0 Client, e.g. Leave Request Application. The default Token Lifetime of issued Access Tokens is one hour (3600s). For security reasons you can shorten the Token Lifetime.
|
|
3. Define the OAuth 2.0 Client Authentication Details When you activate the option “Client User Id & Password”, the requests to the AS ABAP’s OAuth 2.0 Token Endpoint must contain username and password. The server requires an HTTP Authorization Header containing the username LEAVEAPP and password. You can also allow that the OAuth 2.0 Client authenticates with an SSL Client certificate during the SSL handshake.
|
|
4. Define the Resource Owner Authentication Details |
|
5. Assign the following two scopes to the OAuth 2.0 Client LEAVEAPP:
|
|
6. Check the OAuth 2.0 Client Summary once again and choose Finish. In this last wizard step you can see all settings at a glance. |
As a result the OAuth 2.0 Client is completely configured for using authorization code grand type.