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
If you for some reason need to manipulate the system time/clock you can configure the OAuth2TokenProvider to use a specific time, resulting in the `iat` claim being set to that time:
val token = server.issueToken(issuerId ="issuer1")
198
+
// do whatever token testing you need to do here and assert the token has iat=2020-01-21T00:00:00Z
199
+
}
200
+
```
186
201
187
202
##### More examples
188
203
@@ -285,6 +300,17 @@ add this to your config with preferred `JWS algorithm`:
285
300
}
286
301
```
287
302
303
+
A token provider can also support a static "systemTime", i.e. the time for when the token is issued (`iat` claim) if you have tests that require a specific time.
304
+
The following configuration will set the system time to `2020-01-21T00:00:00Z`:
| `interactiveLogin` | `true` or `false`, enables login screen when redirecting to server `/authorize` endpoint |
@@ -294,7 +320,7 @@ add this to your config with preferred `JWS algorithm`:
294
320
| `httpServer` | A string identifying the httpserver to use. Must match one of the following enum values: `MockWebServerWrapper` or `NettyWrapper` |
295
321
| `tokenCallbacks` | A list of [`RequestMappingTokenCallback`](src/main/kotlin/no/nav/security/mock/oauth2/token/OAuth2TokenCallback.kt) that lets you specify which token claims to return when a token request matches the specified condition. |
296
322
297
-
*From the JSON example above:*
323
+
*From the first JSON example above:*
298
324
299
325
A token request to `http://localhost:8080/issuer1/token` with parameter `scope` equal to `scope1` will match the first `tokenCallback`:
0 commit comments