Register Services (G4GREGSVC)

                          Register Service (G4GREGSVC)        
           
Type choices, press Enter.
Google ID  . . . . . . . . . . .   ___________________________________________________
Service  . . . . . . . . . . . .   *CLOUDPRINT
                                                
                           Additional Parameters                              
Authorization Method . . . . . .   __________    *DEVICE, *WEB 
CCSID  . . . . . . . . . . . . .   819           Number
Debug  . . . . . . . . . . . . .   *NO           *YES, *NO
Debug File . . . . . . . . . . .   ___________________________________________________
                                                                     Bottom
F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display   
F24=More keys                                                             

The G4GREGSVC command allows you to register a service with your Google ID. Registering a service allows G4G to access the functionality of this service for the ID specified using OAuth v2.0 security.

When this command is run you'll be presented with a URL to go to in your browser after first signing into your Google account.

Next you'll be given a code to enter when asked. You will then be asked in the browser if you wish to grant access to G4G to the specific service. Once complete, G4G will have access to the particular service for your Google ID.

See the example below for the flow you should expect.

  • Google ID - Specify the Google ID that you want to register a service for. Normally this is your Gmail address (including gmail.com).
  • Service - Specify the service to register.
  • Authorization Method - Specify *WEB first for the authorization method. If that fails, then try *DEVICE.
  • CCSID - Sepcify a CCSID to use for data conversions.
  • Debug - Specify *YES to turn on debugging.
  • Debug File - Enter the fully qualified name of the debug file you wish to use. If left blank, this value defaults to /tmp/g4g_<id>_registerServiceDebug.txt.

Example of Registering the Google Cloud Print service.

First the following command is entered:

G4GREGSVC ID(bvstone@gmail.com) SERVICE(*CLOUDPRINT)

You will then be presented with a screen similar to the following:

You will then sign into your Google Account and copy and paste the URL shown above. You will be presented with a web page similar to the following:

You will then copy and paste the code from the G4G screen into the space provided on the web page (making sure there there are no trailing blanks, etc).

You will then be presented with a page that will ask if you want to allow GreenTools for Google Apps (G4G) access to the particular application. In this example we were setting up Google Cloud Print, so we are presented with the following web page:

Now, we simply click the "Allow access" button and we will be presented with the following screen:

Now, return to the G4G display that we copied the code from and press the F6 key to continue. At this point G4G will connect to Google and retrieve the required authorization codes so that it can work with the service requested. It will also perform any other work (such as requesting a list of Google Cloud Printers that are available using the G4GLSTPRT command).

When this is complete and no errors occur, your G4G display should look similar to the following:

At this point you're ready to use commands associated with that service!