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;
}
Aggregations