diff --git a/extensions/oidc-client/runtime/src/main/java/io/quarkus/oidc/client/runtime/OidcClientRecorder.java b/extensions/oidc-client/runtime/src/main/java/io/quarkus/oidc/client/runtime/OidcClientRecorder.java index 76d70d23432c2..5bfa8f1a952f5 100644 --- a/extensions/oidc-client/runtime/src/main/java/io/quarkus/oidc/client/runtime/OidcClientRecorder.java +++ b/extensions/oidc-client/runtime/src/main/java/io/quarkus/oidc/client/runtime/OidcClientRecorder.java @@ -142,15 +142,17 @@ public OidcClient apply(String tokenRequestUri, Throwable t) { : OidcConstants.PASSWORD_GRANT; setGrantClientParams(oidcConfig, tokenGrantParams, grantType); - Map 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 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());