OAuth 2.0 support

PowerBuilder provides a set of objects and APIs for working with OAuth 2.0 authorization servers. These objects and APIs support requesting access tokens and accessing protected resources, including:

  • 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.

    Related properties: ClientId, ClientSecret, GrantType, Method, Password, TokenLocation, UserName

    Related functions: AppendParam, ClearHeaders, ClearParams, SetHeader

  • 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.

    Related functions: GetAccessToken, GetBody

  • OAuthClient -- provides interfaces for obtaining the access token and protected resources.

    Related functions: AccessToken, RequestResource

  • 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.

    Related properties: Method, URL

    Related functions: SetAccessToken, SetBody, ClearHeaders, SetHeader, GetBody

  • ResourceResponse -- obtains the response information of the protected resource request, including the HTTP response headers and the protected resource returned from the server.

    Related functions: GetBody, GetStatusCode, GetStatusText

  • RESTClient Retrieve function is extended with "tokenrequest" parameter for working with OAuth 2.0.