Skip to content

Commit

Permalink
KEYCLOAK-18551 Fixed the adapter to use dynamic openid-configuration …
Browse files Browse the repository at this point in the history
…instead of building the tokenUrl by itself.
  • Loading branch information
Adamczyk Błażej authored and pedroigor committed Oct 4, 2021
1 parent 4e6e125 commit e5b05d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ protected AccessTokenResponse getToken(String username, String password) throws
AccessTokenResponse tokenResponse=null;
HttpClient client = deployment.getClient();

HttpPost post = new HttpPost(
KeycloakUriBuilder.fromUri(deployment.getAuthServerBaseUrl())
.path(ServiceUrlConstants.TOKEN_PATH).build(deployment.getRealm()));
HttpPost post = new HttpPost(deployment.getTokenUrl());
java.util.List <NameValuePair> formparams = new java.util.ArrayList <NameValuePair>();
formparams.add(new BasicNameValuePair(OAuth2Constants.GRANT_TYPE, OAuth2Constants.PASSWORD));
formparams.add(new BasicNameValuePair("username", username));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ protected Logger getLogger() {

protected Auth directGrantAuth(String username, String password) throws IOException, VerificationException {
String authServerBaseUrl = deployment.getAuthServerBaseUrl();
URI directGrantUri = KeycloakUriBuilder.fromUri(authServerBaseUrl).path(ServiceUrlConstants.TOKEN_PATH).build(deployment.getRealm());
HttpPost post = new HttpPost(directGrantUri);

HttpPost post = new HttpPost(deployment.getTokenUrl());
List<NameValuePair> formparams = new ArrayList<NameValuePair>();
formparams.add(new BasicNameValuePair(OAuth2Constants.GRANT_TYPE, OAuth2Constants.PASSWORD));
formparams.add(new BasicNameValuePair("username", username));
Expand Down

0 comments on commit e5b05d0

Please sign in to comment.