g4ms_refreshToken
*//////////////////////////////////////////////////////////////*
* g4ms_refreshToken - Refresh the token *
* *
* Output: *
* Out_errMsg - The error message (if error exists). *
* Out_newToken - The new OAuth 2.0 token. *
* *
* Returns: *
* -1 for error, 0 for success *
* *
* Input Variables ([r]=required) *
* In_id - MS ID [r] *
* In_service - Service Name [r] *
* In_ccsid - The CCSID to use (1208) *
* In_debug - Turn on Debug (*NO, *YES) *
* In_debugFile - The debug file name. *
* *
*//////////////////////////////////////////////////////////////*
D #g4ms_refreshToken...
D PR 10i 0
D In_id 256 Value
D In_service 64 Value
D Out_newToken 4096
D Out_errorMsg 256
D In_ccsid 7 0 Value Options(*NOPASS)
D In_debug 4 Value Options(*NOPASS)
D In_debugFile 256 Value Options(*NOPASS)
g4ms_refreshToken will attempt to refresh the token for an account/service. If a refresh is not needed (within 60 seconds of the token expiration) the original token will be returned.
Returns: 0 for successful creation, -1 for error.
Input Parameters:
In_id - The Microsoft ID to refresh to the token for. (required)
In_service - The service (as set up in the G4MSSVCPF file) to refresh the token for. (required)
In_ccsid - The CCSID to use. Defaults to 1208.
In_debug - Turn debug on (*YES) or off (*NO). Default is *NO.
In_debugFile - The name of the debug file to use. If not specified, the default of /tmp/g4ms_refreshToken.<id>.refreshToken will be used where <id> is a unique ID generated by G4MS.
Output Parameters:
Out_newToken - The new token, if required. Otherwise the current token will be returned.