diff --git a/examples/relying-party-spring-boot/src/main/java/it/spid/cie/oidc/spring/boot/relying/party/RelyingPartyWrapper.java b/examples/relying-party-spring-boot/src/main/java/it/spid/cie/oidc/spring/boot/relying/party/RelyingPartyWrapper.java index 01013db..0f51b16 100644 --- a/examples/relying-party-spring-boot/src/main/java/it/spid/cie/oidc/spring/boot/relying/party/RelyingPartyWrapper.java +++ b/examples/relying-party-spring-boot/src/main/java/it/spid/cie/oidc/spring/boot/relying/party/RelyingPartyWrapper.java @@ -48,10 +48,10 @@ public JSONObject getUserInfo(String state, String code) } public String getUserKey(JSONObject userInfo) { - String userKey = userInfo.optString("email"); + String userKey = userInfo.optString("sub"); if (Validator.isNullOrEmpty(userKey)) { - userKey = userInfo.optString("email", ""); + userKey = userInfo.optString("sub ", ""); } return userKey; diff --git a/starter-kit/src/test/java/it/spid/cie/oidc/handler/TestRelyingPartyHandlerWellKnown.java b/starter-kit/src/test/java/it/spid/cie/oidc/handler/TestRelyingPartyHandlerWellKnown.java index b7e2e7e..034a931 100644 --- a/starter-kit/src/test/java/it/spid/cie/oidc/handler/TestRelyingPartyHandlerWellKnown.java +++ b/starter-kit/src/test/java/it/spid/cie/oidc/handler/TestRelyingPartyHandlerWellKnown.java @@ -22,7 +22,7 @@ public class TestRelyingPartyHandlerWellKnown { private static String TRUST_ANCHOR = "http://127.0.0.1:18000/"; private static String SPID_PROVIDER = "http://127.0.0.1:18000/oidc/op/"; - private static String RELYING_PARTY = "http://127.0.0.1:18080/oidc/rp/"; + private static String RELYING_PARTY = "http://127.0.0.1:18080/oidc/rp"; @Test public void testClass1() { @@ -142,7 +142,7 @@ public void testWellKnown2d() { options, new MemoryStorage()); wellKnown = handler.getWellKnownData( - RELYING_PARTY + OIDCConstants.OIDC_FEDERATION_WELLKNOWN_URL, + RELYING_PARTY + "/" + OIDCConstants.OIDC_FEDERATION_WELLKNOWN_URL, true); } catch (Exception e) { @@ -196,10 +196,10 @@ public void testWellKnown2f() { options, new MemoryStorage()); handler.getWellKnownData( - RELYING_PARTY + OIDCConstants.OIDC_FEDERATION_WELLKNOWN_URL, true); + RELYING_PARTY + "/" + OIDCConstants.OIDC_FEDERATION_WELLKNOWN_URL, true); wellKnown = handler.getWellKnownData( - RELYING_PARTY + OIDCConstants.OIDC_FEDERATION_WELLKNOWN_URL, true); + RELYING_PARTY + "/" + OIDCConstants.OIDC_FEDERATION_WELLKNOWN_URL, true); } catch (Exception e) { catched = true;