tibemsOAuth2Params_SetTokenFetchCallback
Function
Purpose
Set a callback that will be invoked whenever a regular or an administration connection needs to acquire an OAuth 2.0 access token.
C Declaration
tibems_status tibemsOAuth2Params_SetTokenFetchCallback( tibemsOAuth2Params params, tibemsOAuth2TokenFetchCallbackEx callback, void* closure )
IBM Systems
This function is not supported on z/OS and IBM i systems.
Parameters
Parameter | Description |
---|---|
params
|
Set the value in this OAuth 2.0 parameter object. |
callback |
Use this callback function to obtain OAuth 2.0 access tokens. |
closure |
Data to be passed into tibemsOAuth2TokenFetchCallbackEx. |
Remarks
A regular or an administration connection can be set to directly contact an OAuth 2.0 provider and request OAuth 2.0 access tokens. If you wish to instead procure access tokens via an external mechanism and provide them directly to your connections, you can use this function to set a callback that will be invoked whenever an access token is required.
Note: A connection created using params will determine how to obtain access tokens based on the configured OAuth 2.0 parameters (these consist of the parameters set in
params
and the parameters set globally via environment variables). If the OAuth 2.0 parameters include an access token, it is directly used. Otherwise, if the OAuth 2.0 parameters contain a user-defined callback, the connection will invoke that callback whenever it requires an access token. If neither of these are present, the connection will use the remaining OAuth 2.0 parameters to request access tokens from an authorization server via an OAuth 2.0 grant.