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
Copy file name to clipboardExpand all lines: docs/security/authentication.adoc
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,7 +107,7 @@ NOTE: RGT cookies can only be verified by the RESTHeart instance that issued the
107
107
108
108
This component is responsible for initiating a user's authenticated session by setting the authentication cookie.
109
109
110
-
Activates when a URL includes the query parameter `?set-auth-cookie` and a user is authenticated, setting a cookie populated with a token generated by the enabled Token Manager.
110
+
Activates when the `/token/cookie` endpoint is called with valid credentials, setting a cookie populated with a token generated by the enabled Token Manager.
111
111
112
112
*Configuration*
113
113
@@ -124,7 +124,9 @@ authCookieSetter:
124
124
expires-ttl: 86400 # Defines the duration (in seconds, default 1 day) for which the cookie is valid
125
125
```
126
126
127
-
When using JWT tokens, the cookie can be updated by calling `POST /token/cookie?renew`. The query parameter `renew` forces the `jwtTokenManager` to update the JWT.
127
+
When using JWT tokens, the cookie can be updated by calling `POST /token/cookie?renew`. The query parameter `renew` forces the `jwtTokenManager` to generate a new JWT token.
128
+
129
+
You can also add the `?renew` query parameter to `GET /token` or `GET /token/cookie` requests to force token renewal.
128
130
129
131
===== authCookieHandler
130
132
@@ -358,12 +360,10 @@ jwtTokenManager:
358
360
issuer: restheart.com
359
361
----
360
362
361
-
The query parameter renew-auth-token forces the token to be renewed.
363
+
The query parameter `renew` forces the token to be renewed. Add it to `GET /token` or `GET /token/cookie` requests (e.g., `GET /token?renew`).
362
364
363
-
Generating a new token is a cryptographic operation,
364
-
and it can have a significant performance overhead.
365
-
It is responsibility of the client to renew the token using this query parameter
366
-
when it is going to expiry somehow soon.
365
+
Generating a new token is a cryptographic operation and can have a significant performance overhead.
366
+
It is the responsibility of the client to renew the token using this query parameter when it is going to expire soon.
NOTE: Generating a new token is a cryptographic operation and can have significant performance overhead. It is the responsibility of the client to renew the token using this query parameter when it is going to expire soon.
295
+
255
296
===== Cookie-Based Authentication
256
297
257
298
For browser-based applications, use the `/token/cookie` endpoint to set an HttpOnly cookie (more secure as the token isn't exposed to JavaScript):
0 commit comments