File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
tokens/src/main/java/io/scalecube/security/tokens/jwt Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 3
3
import java .util .Map ;
4
4
import reactor .core .publisher .Mono ;
5
5
6
- @ FunctionalInterface
7
6
public interface JwtTokenResolver {
8
7
8
+ /**
9
+ * Parses and returns token claims without verification.
10
+ *
11
+ * @param token jwt token
12
+ * @return parsed claims
13
+ */
14
+ Map <String , Object > parseBody (String token );
15
+
9
16
/**
10
17
* Verifies and returns token claims if everything went ok.
11
18
*
Original file line number Diff line number Diff line change @@ -82,6 +82,13 @@ public JwtTokenResolverImpl cleanupInterval(Duration cleanupInterval) {
82
82
return c ;
83
83
}
84
84
85
+ @ Override
86
+ public Map <String , Object > parseBody (String token ) {
87
+ JwtTokenParser tokenParser = tokenParserFactory .newParser (token );
88
+ JwtToken jwtToken = tokenParser .parseToken ();
89
+ return jwtToken .body ();
90
+ }
91
+
85
92
@ Override
86
93
public Mono <Map <String , Object >> resolve (String token ) {
87
94
return Mono .defer (
You can’t perform that action at this time.
0 commit comments