g4ms_exchangeCodeForToken

*//////////////////////////////////////////////////////////////*

* g4ms_exchangeCodeForToken - Exchange Code for Token *

* *

* Output: *

* Out_errMsg - The error message (if error exists). *

* *

* Returns: *

* -1 for error, 0 for success *

* *

* Settable Variables ([r]=required) *

* id - Microsoft ID [r] *

* service - The service to register [r] *

* state_code - The state code returned from *

* g4ms_getRegistrationURL [r] *

* register_groups - Specify *YES to also register the scopes *

* for groups. *

* ccsid - The CCSID to use (1208) *

* debug - Turn on Debug (*NO, *YES) *

* debug_file - The debug file name. *

* (/tmp/g4ms_[id]_exchangeCodeForToken.txt) *

* *

*//////////////////////////////////////////////////////////////*

D g4ms_exchangeCodeForToken...

D PR 10i 0

D Out_errMsg 256 Options(*NOPASS)

g4ms_exchangeCodeForToken is used to retrieve an OAuth token (and other information). If successful, the user will be set up to use the service with the account that was registered.

Returns: 0 for successful creation, -1 for error.

Output Parameters:

  • Out_errorMsg - An error message if an error was encountered.

Settable Variables:

  • id - Microsoft ID [required]

  • service - The service to register [required]

  • state_code - The state code returned from g4ms_getRegistrationURL() [required]

  • register_groups - Specify *YES to add the scopes/permissions to use Groups.

  • ccsid - The CCSID to use (1208)

  • debug - Turn on Debug (*NO, *YES)

  • debug_file - The debug file name. The default is /tmp/g4ms_[id]_getRegistrationURL.txt)