g4g_getRegistrationURL()


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

* g4g_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 - Google ID [r] *

* service - The service to register [r] *

* ccsid - The CCSID to use (1208) *

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

* debug_file - The debug file name. *

* (/tmp/g4g_[id]_getRegistrationURL.txt) *

* *

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

D g4g_getRegistrationURL...

D PR 10i 0

D Out_stateCode 256

D Out_URL 1024

D Out_errMsg 256 Options(*NOPASS)

g4g_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 g4g_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 Google verification for the service. They will need to make sure they are not signed in, or already signed into their Google account.

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

Settable Variables:

  • id - Google ID [required]

  • service - The service to register [required]

  • ccsid - The CCSID to use (1208)

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

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