Skip to content

Commit

Permalink
fix(openid): Normalize OpenID configuration path
Browse files Browse the repository at this point in the history
When the issuer has trailing `/` character, the OpenID configuration path results to be incorrectly encoded
  • Loading branch information
MDeLuise authored and Coduz committed Jul 3, 2023
1 parent 6969ea7 commit b4fb7c0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ public static String getOpenIdConfPath(String issuer) throws OpenIDIllegalArgume
}
String openIdConfPath = issuer + "/" + openIDConfPathSuffix;
try {
new URL(openIdConfPath);
return openIdConfPath;
} catch (MalformedURLException mue) {
URL normalizedURL = new URI(openIdConfPath).normalize().toURL();
return normalizedURL.toString();
} catch (MalformedURLException | URISyntaxException mue) {
throw new OpenIDIllegalUriException("openIdConfPath", openIdConfPath);
}
}
Expand Down

0 comments on commit b4fb7c0

Please sign in to comment.