issueJWT method

Future<ClientResponse<IssueResponse, Errors>> issueJWT(
  1. String applicationId,
  2. String encodedJWT,
  3. String refreshToken
)

Issue a new access token (JWT) for the requested Application after ensuring the provided JWT is valid. A valid access token is properly signed and not expired.

This API may be used in an SSO configuration to issue new tokens for another application after the user has obtained a valid token from authentication.

@param {String} applicationId The Application Id for which you are requesting a new access token be issued. @param {String} encodedJWT The encoded JWT (access token). @param {String} refreshToken (Optional) An existing refresh token used to request a refresh token in addition to a JWT in the response.

The target application represented by the applicationId request parameter must have refresh tokens enabled in order to receive a refresh token in the response.

@returns {Promise

Implementation

Future<ClientResponse<IssueResponse, Errors>> issueJWT(
    String applicationId, String encodedJWT, String refreshToken) {
  return _startAnonymous<IssueResponse, Errors>()
      .withUri('/api/jwt/issue')
      .withAuthorization('Bearer ' + encodedJWT)
      .withParameter('applicationId', applicationId)
      .withParameter('refreshToken', refreshToken)
      .withMethod('GET')
      .withResponseHandler(
          defaultResponseHandlerBuilder((d) => IssueResponse.fromJson(d)))
      .go();
}