Skip to content

Commit 1c1430c

Browse files
committed
pull forward commit from #93
1 parent 41401f8 commit 1c1430c

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

build.savant

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ logbackVersion = "1.5.13"
2929
slf4jVersion = "2.0.13"
3030
testngVersion = "7.8.0"
3131

32-
project(group: "org.primeframework", name: "prime-mvc", version: "5.3.1", licenses: ["ApacheV2_0"]) {
32+
project(group: "org.primeframework", name: "prime-mvc", version: "5.4.0", licenses: ["ApacheV2_0"]) {
3333
workflow {
3434
fetch {
3535
// Dependency resolution order:

pom.xml

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

66
<groupId>org.primeframework</groupId>
77
<artifactId>prime-mvc</artifactId>
8-
<version>5.3.1</version>
8+
<version>5.4.0</version>
99
<packaging>jar</packaging>
1010

1111
<name>FusionAuth App</name>

src/main/java/org/primeframework/mvc/security/BaseJWTRefreshTokenCookiesUserLoginSecurityContext.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public Object getCurrentUser() {
9898
return null;
9999
}
100100

101-
user = retrieveUserForJWT(tokens.jwt);
101+
user = retrieveUserForJWT(tokens.decodedJWT, tokens.jwt);
102102
if (user == null) {
103103
jwtCookie.delete(request, response);
104104
} else {
@@ -207,12 +207,13 @@ protected boolean isRevoked(@SuppressWarnings("unused") JWT jwt) {
207207
protected abstract String refreshTokenCookieName();
208208

209209
/**
210-
* Retrieve a user given an encoded JWT string.
210+
* Retrieve a user with the encoded JWT string or the decoded JWT object.
211211
*
212-
* @param jwt the encoded JWT string
212+
* @param decodedJWT the decoded JWT object
213+
* @param jwt the encoded JWT string
213214
* @return a user object.
214215
*/
215-
protected abstract Object retrieveUserForJWT(String jwt);
216+
protected abstract Object retrieveUserForJWT(JWT decodedJWT, String jwt);
216217

217218
/**
218219
* The JWT that is passed to this method is known to be valid. The signature has been validated, and the JWT is not expired.
@@ -223,6 +224,7 @@ protected boolean isRevoked(@SuppressWarnings("unused") JWT jwt) {
223224
* @return true if the validation is ok and the JWT can be used. False if the JWT is not ok- and it should not be used. Returning true will still
224225
* allow a refresh token to be used if available.
225226
*/
227+
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
226228
protected boolean validateJWTClaims(@SuppressWarnings("unused") JWT jwt) {
227229
return true;
228230
}

src/test/java/org/primeframework/mvc/security/MockOAuthUserLoginSecurityContext.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.google.inject.Inject;
2525
import io.fusionauth.http.server.HTTPRequest;
2626
import io.fusionauth.http.server.HTTPResponse;
27+
import io.fusionauth.jwt.domain.JWT;
2728
import org.primeframework.mvc.security.oauth.OAuthConfiguration;
2829
import org.primeframework.mvc.security.oauth.TokenAuthenticationMethod;
2930
import org.primeframework.mvc.security.oauth.Tokens;
@@ -110,7 +111,7 @@ protected String refreshTokenCookieName() {
110111
}
111112

112113
@Override
113-
protected Object retrieveUserForJWT(String jwt) {
114+
protected Object retrieveUserForJWT(JWT decodedJWT, String jwt) {
114115
return CurrentUser;
115116
}
116117
}

0 commit comments

Comments
 (0)