KEYCLOAK-18551 Fixed the adapter to use dynamic openid-configuration instead of building the tokenUrl by itself.
This commit is contained in:
parent
4e6e125ede
commit
e5b05d05f0
2 changed files with 2 additions and 6 deletions
|
@ -89,9 +89,7 @@ public class BasicAuthRequestAuthenticator extends BearerTokenRequestAuthenticat
|
||||||
AccessTokenResponse tokenResponse=null;
|
AccessTokenResponse tokenResponse=null;
|
||||||
HttpClient client = deployment.getClient();
|
HttpClient client = deployment.getClient();
|
||||||
|
|
||||||
HttpPost post = new HttpPost(
|
HttpPost post = new HttpPost(deployment.getTokenUrl());
|
||||||
KeycloakUriBuilder.fromUri(deployment.getAuthServerBaseUrl())
|
|
||||||
.path(ServiceUrlConstants.TOKEN_PATH).build(deployment.getRealm()));
|
|
||||||
java.util.List <NameValuePair> formparams = new java.util.ArrayList <NameValuePair>();
|
java.util.List <NameValuePair> formparams = new java.util.ArrayList <NameValuePair>();
|
||||||
formparams.add(new BasicNameValuePair(OAuth2Constants.GRANT_TYPE, OAuth2Constants.PASSWORD));
|
formparams.add(new BasicNameValuePair(OAuth2Constants.GRANT_TYPE, OAuth2Constants.PASSWORD));
|
||||||
formparams.add(new BasicNameValuePair("username", username));
|
formparams.add(new BasicNameValuePair("username", username));
|
||||||
|
|
|
@ -86,9 +86,7 @@ public class DirectAccessGrantsLoginModule extends AbstractKeycloakLoginModule {
|
||||||
|
|
||||||
protected Auth directGrantAuth(String username, String password) throws IOException, VerificationException {
|
protected Auth directGrantAuth(String username, String password) throws IOException, VerificationException {
|
||||||
String authServerBaseUrl = deployment.getAuthServerBaseUrl();
|
String authServerBaseUrl = deployment.getAuthServerBaseUrl();
|
||||||
URI directGrantUri = KeycloakUriBuilder.fromUri(authServerBaseUrl).path(ServiceUrlConstants.TOKEN_PATH).build(deployment.getRealm());
|
HttpPost post = new HttpPost(deployment.getTokenUrl());
|
||||||
HttpPost post = new HttpPost(directGrantUri);
|
|
||||||
|
|
||||||
List<NameValuePair> formparams = new ArrayList<NameValuePair>();
|
List<NameValuePair> formparams = new ArrayList<NameValuePair>();
|
||||||
formparams.add(new BasicNameValuePair(OAuth2Constants.GRANT_TYPE, OAuth2Constants.PASSWORD));
|
formparams.add(new BasicNameValuePair(OAuth2Constants.GRANT_TYPE, OAuth2Constants.PASSWORD));
|
||||||
formparams.add(new BasicNameValuePair("username", username));
|
formparams.add(new BasicNameValuePair("username", username));
|
||||||
|
|
Loading…
Reference in a new issue