JAVA-20555 use Java Base64 instead of deprecated Spring Base64Utils (#13941)
This commit is contained in:
committed by
GitHub
parent
2518992634
commit
de11e3cb6c
@@ -5,11 +5,11 @@ import io.github.jhipster.config.JHipsterProperties;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.Base64Utils;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Base64;
|
||||
|
||||
/**
|
||||
* Client talking to UAA's token endpoint to do different OAuth2 grants.
|
||||
@@ -34,7 +34,7 @@ public class UaaTokenEndpointClient extends OAuth2TokenEndpointClientAdapter imp
|
||||
String clientId = getClientId();
|
||||
String clientSecret = getClientSecret();
|
||||
String authorization = clientId + ":" + clientSecret;
|
||||
return "Basic " + Base64Utils.encodeToString(authorization.getBytes(StandardCharsets.UTF_8));
|
||||
return "Basic " + Base64.getEncoder().encodeToString(authorization.getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user