Skip to content

Commit

Permalink
fix: claim sub instead of email, fix wellknown tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rglauco committed Mar 18, 2024
1 parent 7224ac4 commit 202c8da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 202c8da

Please sign in to comment.