Skip to content

Commit

Permalink
Merge pull request #16273 from sberyozkin/fix_oidc_client_test
Browse files Browse the repository at this point in the history
Fix OidcClient test failure
  • Loading branch information
gsmet authored Apr 6, 2021
2 parents afd902c + 1ae81eb commit e7f7bea
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,17 @@ public OidcClient apply(String tokenRequestUri, Throwable t) {
: OidcConstants.PASSWORD_GRANT;
setGrantClientParams(oidcConfig, tokenGrantParams, grantType);

Map<String, String> grantOptions = oidcConfig.getGrantOptions()
.get(oidcConfig.grant.getType().name().toLowerCase());
if (oidcConfig.grant.getType() == Grant.Type.PASSWORD) {
tokenGrantParams.add(OidcConstants.PASSWORD_GRANT_USERNAME,
grantOptions.get(OidcConstants.PASSWORD_GRANT_USERNAME));
tokenGrantParams.add(OidcConstants.PASSWORD_GRANT_PASSWORD,
grantOptions.get(OidcConstants.PASSWORD_GRANT_PASSWORD));
} else if (grantOptions != null && oidcConfig.grant.getType() == Grant.Type.CLIENT) {
tokenGrantParams.addAll(grantOptions);
if (oidcConfig.getGrantOptions() != null) {
Map<String, String> grantOptions = oidcConfig.getGrantOptions()
.get(oidcConfig.grant.getType().name().toLowerCase());
if (oidcConfig.grant.getType() == Grant.Type.PASSWORD) {
tokenGrantParams.add(OidcConstants.PASSWORD_GRANT_USERNAME,
grantOptions.get(OidcConstants.PASSWORD_GRANT_USERNAME));
tokenGrantParams.add(OidcConstants.PASSWORD_GRANT_PASSWORD,
grantOptions.get(OidcConstants.PASSWORD_GRANT_PASSWORD));
} else if (grantOptions != null && oidcConfig.grant.getType() == Grant.Type.CLIENT) {
tokenGrantParams.addAll(grantOptions);
}
}

MultiMap commonRefreshGrantParams = new MultiMap(io.vertx.core.MultiMap.caseInsensitiveMultiMap());
Expand Down

0 comments on commit e7f7bea

Please sign in to comment.