Merge pull request #3699 from stianst/KEYCLOAK-4090

KEYCLOAK-4090
This commit is contained in:
Stian Thorgersen 2017-01-03 10:27:59 +01:00 committed by GitHub
commit d217b23719

View file

@ -245,7 +245,7 @@ public class OIDCIdentityProvider extends AbstractOAuth2IdentityProvider<OIDCIde
if (!getConfig().isDisableUserInfoService()) {
String userInfoUrl = getUserInfoUrl();
if (userInfoUrl != null && (id == null || name == null || preferredUsername == null || email == null)) {
if (userInfoUrl != null && !userInfoUrl.isEmpty() && (id == null || name == null || preferredUsername == null || email == null)) {
SimpleHttp request = JsonSimpleHttp.doGet(userInfoUrl)
.header("Authorization", "Bearer " + accessToken);
JsonNode userInfo = JsonSimpleHttp.asJson(request);