Search in sources :

Example 1 with GetAccessTokenByRefreshTokenParams

use of io.jans.ca.common.params.GetAccessTokenByRefreshTokenParams in project jans by JanssenProject.

the class GetTokensByCodeTest method refreshToken.

public static GetClientTokenResponse refreshToken(GetTokensByCodeResponse2 resp, ClientInterface client, RegisterSiteResponse site) {
    notEmpty(resp.getRefreshToken());
    // refresh token
    final GetAccessTokenByRefreshTokenParams refreshParams = new GetAccessTokenByRefreshTokenParams();
    refreshParams.setRpId(site.getRpId());
    refreshParams.setScope(Lists.newArrayList("openid", "jans_client_api"));
    refreshParams.setRefreshToken(resp.getRefreshToken());
    GetClientTokenResponse refreshResponse = client.getAccessTokenByRefreshToken(Tester.getAuthorization(site), null, refreshParams);
    assertNotNull(refreshResponse);
    notEmpty(refreshResponse.getAccessToken());
    notEmpty(refreshResponse.getRefreshToken());
    return refreshResponse;
}
Also used : GetAccessTokenByRefreshTokenParams(io.jans.ca.common.params.GetAccessTokenByRefreshTokenParams) GetClientTokenResponse(io.jans.ca.common.response.GetClientTokenResponse)

Aggregations

GetAccessTokenByRefreshTokenParams (io.jans.ca.common.params.GetAccessTokenByRefreshTokenParams)1 GetClientTokenResponse (io.jans.ca.common.response.GetClientTokenResponse)1