tibemsOAuth2TokenFetchCallback
Type
Purpose
Obtain an OAuth 2.0 access token to be used for authenticating with the EMS server during connection establishment.
C Declaration
typedef tibems_status (*tibemsOAuth2TokenFetchCallback) ( char** accessToken, tibemsConnection connection );
IBM Systems
This type is not supported on z/OS and IBM i systems.
Parameters
Parameter | Description |
---|---|
accessToken |
The callback must store the OAuth 2.0 access token in this variable. |
connection |
The connection object that requires the OAuth 2.0 access token. |
Remarks
To use OAuth 2.0 access tokens obtained via an external mechanism, your program can define callbacks of this type and register them with connection factories (using tibemsConnectionFactory_SetOAuth2TokenFetchCallback
). Connections created using a particular connection factory will use the corresponding callback to obtain access tokens for authenticating with the EMS server.
The accessToken
parameter serves as an in-out-parameter. The callbacks must store the access token in this variable in order for the token to be made available to the connection object. Memory allocated for accessToken
by the callbacks will automatically be freed by the connection object once the authentication attempt is complete.
If a valid access token was obtained and stored in accessToken
, the callbacks should indicate success by returning a tibems_status
value of TIBEMS_OK
. If a valid access token could not be obtained, an appropriate tibems_status
value should be returned to indicate failure.