The following objects are provided to support OAuth 2.0:
-
TokenRequest -- gets or sets the properties for the access token request, including the address of the authorization server, the OAuth 2.0 authorization process, the scope of the access request, the secure protocol, the timeout value etc. For more information, refer to the section called “TokenRequest object” in Objects and Controls.
-
TokenResponse -- gets the information of the access token response returned by the authorization server, including the access token, the refresh token, the HTTP response header etc. For more information, refer to the section called “TokenResponse object” in Objects and Controls.
-
OAuthClient -- provides interfaces for obtaining the access token and protected resources. For more information, refer to the section called “OAuthClient object” in Objects and Controls.
-
OAuthRequest -- uses the access token to obtain each property of the HTTP request of the protected resource, including the server address, the request header, the secure protocol, the timeout value etc. For more information, refer to the section called “OAuthRequest object” in Objects and Controls.
-
ResourceResponse -- obtains the response information of the protected resource request, including the HTTP response headers and the protected resource returned from the server. For more information, refer to the section called “ResourceResponse object” in Objects and Controls.
RESTClient Retrieve function is extended with "tokenrequest" parameter for supporting oAuth 2.0. For more about the syntax, refer to the section called “Retrieve” in PowerScript Reference.
For more code examples about the OAuth 2.0 grant type, refer to the section called “Supporting OAuth 2.0 Authorization Server” in Application Techniques.