g4ms_getRegistrationURL
*//////////////////////////////////////////////////////////////*
* g4ms_getRegistrationURL - Get Registration URL *
* *
* Returns: *
* -1 for error, 0 if ok *
* *
* Output Variables: *
* Out_stateCode - The unique State Code that will be used *
* to exchange the OAuth 2.0 Code for a Token. *
* Out_URL - The URL to redirect the user to so they can *
* confirm they want to register the specific service for *
* their account. *
* Out_errMsg - Error Message *
* *
* Settable Variables ([r]=required) *
* id - Microsoft ID [r] *
* service - The service to register [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]_getRegistrationURL.txt) *
* *
*//////////////////////////////////////////////////////////////*
D g4ms_getRegistrationURL...
D PR 10i 0
D Out_stateCode 256
D Out_URL 1024
D Out_errMsg 256 Options(*NOPASS)
g4ms_getRegistrationURL is used to begin the process of registering a service for an account. This will return a URL that can be used to display to the user to follow to register the application in a web browser with their account. The state code (Out_stateCode) will also need to be used as it will be a unique ID used when calling g4ms_exchangeCodeForToken().
Returns: 0 for successful creation, -1 for error.
Output Parameters:
Out_stateCode - A unique state code ID that will be used when retrieving a token.
Out_URL - A URL that will bring a user directly to Microsoft verification for the service. They will need to make sure they are not signed in, or already signed into their Microsoft account.
Out_errorMsg - An error message if an error was encountered.
Settable Variables:
id - Microsoft ID [required]
service - The service to register [required]
register_groups - Specify *YES to add the scopes/permissions to register for 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)