Merge branch 'refresh-token-fix' into 'master'

Remove production scope when token is refreshed

See merge request entgra/carbon-device-mgt!860
This commit is contained in:
Pahansith Gunathilake 2022-03-03 04:34:43 +00:00
commit 1e1629e244

View File

@ -656,7 +656,7 @@ public class HandlerUtil {
public static ProxyResponse getTokenResult(AuthData authData, String keymanagerUrl) throws IOException {
HttpPost tokenEndpoint = new HttpPost(keymanagerUrl + HandlerConstants.TOKEN_ENDPOINT);
StringEntity tokenEndpointPayload = new StringEntity(
"grant_type=refresh_token&refresh_token=" + authData.getRefreshToken() + "&scope=PRODUCTION",
"grant_type=refresh_token&refresh_token=" + authData.getRefreshToken(),
ContentType.APPLICATION_FORM_URLENCODED);
tokenEndpoint.setEntity(tokenEndpointPayload);