Skip to content

Commit 556d37d

Browse files
committed
update
1 parent 2f0cdd0 commit 556d37d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<modelVersion>4.0.0</modelVersion>
1212
<artifactId>oauth-token-manager</artifactId>
13-
<version>1.0.5</version>
13+
<version>1.0.6</version>
1414
<name>OauthTokenManager</name>
1515
<packaging>jar</packaging>
1616

src/main/java/info/unterrainer/oauthtokenmanager/OauthTokenManager.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ private TokenVerifier<AccessToken> persistUserInfoInContext(String authorization
116116
if (authorizationHeader == null || authorizationHeader.isBlank())
117117
return null;
118118

119+
if (authorizationHeader.toLowerCase().startsWith("bearer "))
120+
authorizationHeader = authorizationHeader.substring(7);
121+
119122
try {
120123
TokenVerifier<AccessToken> tokenVerifier = TokenVerifier.create(authorizationHeader, AccessToken.class);
121124
RemoteOauthToken remoteAccessToken = RemoteOauthToken.builder()
@@ -127,8 +130,8 @@ private TokenVerifier<AccessToken> persistUserInfoInContext(String authorization
127130
}
128131
// Disabled to enable getting token from side-channels like 'localhost'.
129132
/*
130-
* if (!token.getIssuer().equalsIgnoreCase(authUrl)) {
131-
* setTokenRejectionReason(ctx, "Token has wrong real-url."); return null; }
133+
* if (!remoteAccessToken.getIssuer().equalsIgnoreCase(authUrl)) {
134+
* log.warn("Token has wrong real-url."); return null; }
132135
*/
133136
return tokenVerifier;
134137

0 commit comments

Comments
 (0)