Skip to content

Commit 9c890c2

Browse files
authored
Update auth.md
1 parent 351fa93 commit 9c890c2

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

docs/developer/auth.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ JWT renew tokens follow this structure:
239239
{
240240
"alg": "Ed25519",
241241
"typ": "JWT"
242-
"styp": "renew"
242+
"tkt": "renew"
243243
}
244244
```
245245

@@ -259,9 +259,37 @@ Note the subtype (styp) in the header is set to renew.
259259

260260
A client application will periodically ask Bifrost for a new certificate token and build its own renew token based on this. This can then be used in the backend API calls according to the permissions of the original token. If the original token is revoked by the user, bifrost will not issue a new certificate.
261261

262+
### JWT Renew Certificate Structure
263+
Bifrost creates the renew certificate and signs it with its internal private key.
264+
**Header**:
265+
```json
266+
{
267+
"alg": "Ed25519",
268+
"typ": "JWT"
269+
"tkt": "renewcrt"
270+
}
271+
```
272+
273+
**Payload**:
274+
```json
275+
{
276+
"iss": "7f3a9b2e",
277+
"iat": "2025-04-28T08:50:41Z",
278+
"exp": "2025-04-28T09:10:41Z",
279+
"tnonce": "gxM4TS1jlMXrn8WZYiT2sa6KTj5OykpyyVREsztJmm4",
280+
"delegatedKey": "CQLXd4Py9PENcUQbKZyeiipzzoVrcF8WntzARH9Pvv98",
281+
"nonce": "b88b45e1-fc5a-4cb1-b689-0d8f7f4cba04"
282+
}
283+
```
284+
Where:
285+
- **iss**: The id of the public key in Bifrost
286+
- **tnonce**: The delegate token nonce as specified in attributes.nonce
287+
- **delegatedKey**: The delegated key as specified in the delegate token
288+
289+
### Validation
262290
Validation of a renew token follows the steps:
263291
1. Extract the delegate token and certificate tokens.
264-
2. Ensure valid signatures of the delegate delegate token and certificate tokens (fetch the public key from Bifrost using the keyId in the certificate token).
292+
2. Ensure valid signatures of the delegate token and certificate tokens (fetch the public key from Bifrost using the keyId in the certificate token).
265293
3. Ensure valid signature of renew token (use delegateKey from delegate token)
266294
4. Ensure certificate token is not expired and that nonce is the same in the certificate and the delegate token
267295
5. The renew token is now valid and continued validation of message and permissions can be done.

0 commit comments

Comments
 (0)