Newer Version Available
JWTBearerTokenExchange Class
Namespace
Usage
Use the methods in this class to post a signed JWT bearer token to the OAuth token endpoint, in exchange for an access token.
Example
- Creates the JSON Claims Set.
- Specifies the scope of the request with additional claims.
- Creates the signed JWT.
- Specifies the token endpoint and POSTs to it.
- Gets the access token from the HTTP response.
JWTBearerTokenExchange Constructors
The following are constructors for JWTBearerTokenExchange.
JWTBearerTokenExchange Methods
The following are methods for JWTBearerTokenExchange. All are instance methods.
getAccessToken()
Signature
public String getAccessToken()
Return Value
Type: String
Usage
This method extracts the access_token from the token response. If the token response issues the access token in a different parameter, the request fails.
If you want the full HTTP token response returned, use getHttpResponse instead.
getGrantType()
Signature
public String getGrantType()
Return Value
Type: String
getHttpResponse()
Signature
public System.HttpResponse getHttpResponse()
Return Value
Type: System.HttpResponse
Usage
You can get the access token from the full System.HttpResponse. If you want only the access_token from the token response, you can use getAccessToken instead.
setGrantType(grantType)
Signature
public void setGrantType(String grantType)
Parameters
- grantType
- Type: String
Return Value
Type: void
setJWS(jws)
setTokenEndpoint(tokenEndpoint)
Signature
public void setTokenEndpoint(String tokenEndpoint)
Parameters
- tokenEndpoint
- Type: String
Return Value
Type: void