Skip to content

Commit 49a8848

Browse files
committed
count really weird URIs as "custom scheme"
1 parent 60faf96 commit 49a8848

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

openid-connect-server/src/main/java/org/mitre/oauth2/service/impl/DefaultOAuth2ClientDetailsEntityService.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,13 +287,16 @@ private void checkHeartMode(ClientDetailsEntity client) {
287287
}
288288

289289
// make sure our redirect URIs each fit one of the allowed categories
290-
if (client.getRedirectUris() != null) {
290+
if (client.getRedirectUris() != null && !client.getRedirectUris().isEmpty()) {
291291
boolean localhost = false;
292292
boolean remoteHttps = false;
293293
boolean customScheme = false;
294294
for (String uri : client.getRedirectUris()) {
295295
UriComponents components = UriComponentsBuilder.fromUriString(uri).build();
296-
if (components.getScheme().equals("http")) {
296+
if (components.getScheme() == null) {
297+
// this is a very unknown redirect URI
298+
customScheme = true;
299+
} else if (components.getScheme().equals("http")) {
297300
// http scheme, check for localhost
298301
if (components.getHost().equals("localhost") || components.getHost().equals("127.0.0.1")) {
299302
localhost = true;

0 commit comments

Comments
 (0)