You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add permissions handling
* Add documentation
* Add hint about JWT verification
* Use constant to avoid duplicating default values
* Use equals with ignoreCase switch
val jwtWithScopeClaimSpace ="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCJzY29wZSI6Im9uZSB0d28ifQ.2tPrDymXDejHfVjNlVh4XUj22ZuDrKHP6dvWN7JNAWY"
18
+
/*
19
+
{
20
+
"sub": "1234567890",
21
+
"name": "John Doe",
22
+
"iat": 1516239022,
23
+
"userRights": "one, two"
24
+
}
25
+
*/
26
+
val jwtWithCustomClaimAndSeparator ="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCJ1c2VyUmlnaHRzIjoib25lLCB0d28ifQ.49yk0fq39zMF77ZLJsXH_6D6I3iSDpy-Qk3vZ_PssIY"
27
+
28
+
@Test
29
+
fun`should extract permissions from standard JWT contained in bearer auth header`() {
30
+
val handler = permissionHandler("Bearer $jwtWithScopeClaimSpace")
31
+
32
+
thenRecognizesRequiredPermissions(handler)
33
+
}
34
+
35
+
@Test
36
+
fun`should extract permissions from standard JWT contained in auth header`() {
37
+
val handler = permissionHandler(jwtWithScopeClaimSpace)
38
+
39
+
thenRecognizesRequiredPermissions(handler)
40
+
}
41
+
42
+
@Test
43
+
fun`should extract permissions from custom permissions claim`() {
0 commit comments