Skip to content

Commit 5bccb60

Browse files
committed
always perform strict redirect URI matches in HEART mode
1 parent fa4ed7e commit 5bccb60

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
*/
2020
package org.mitre.oauth2.service.impl;
2121

22+
import org.mitre.openid.connect.config.ConfigurationPropertiesBean;
2223
import org.mitre.openid.connect.service.BlacklistedSiteService;
2324
import org.springframework.beans.factory.annotation.Autowired;
2425
import org.springframework.security.oauth2.common.exceptions.InvalidRequestException;
@@ -43,6 +44,9 @@ public class BlacklistAwareRedirectResolver extends DefaultRedirectResolver {
4344
@Autowired
4445
private BlacklistedSiteService blacklistService;
4546

47+
@Autowired
48+
private ConfigurationPropertiesBean config;
49+
4650
private boolean strictMatch = false;
4751

4852
/* (non-Javadoc)
@@ -80,7 +84,12 @@ protected boolean redirectMatches(String requestedRedirect, String redirectUri)
8084
* @return the strictMatch
8185
*/
8286
public boolean isStrictMatch() {
83-
return strictMatch;
87+
if (config.isHeartMode()) {
88+
// HEART mode enforces strict matching
89+
return true;
90+
} else {
91+
return strictMatch;
92+
}
8493
}
8594

8695
/**

0 commit comments

Comments
 (0)