Main program code for access to secure service
Code to get an access token for a secure RESTful Web service from a Genero application also secured.
Genero RESTful Web services and Genero applications may be secured by either a third-party Identity Provider (IdP), or the Genero Identity Provider (GIP).
When you configure a Genero application protected by an IdP, you must use delegation in the
application configuration. In the
DELEGATE
element you provide details of the IdP
that authenticates access as described in step 1. Note: If the application is not secured, delegation is not required.
In this task as the application accesses (as client) a RESTful Web service that is protected by
an IdP, you must code to get access tokens at runtime. The OAuthAPI.init
function gets the access tokens for the service and
registers them with the GWS engine.