Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/06-concepts/11-authentication/01-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void run(List<String> args) async {
JwtConfig(
// Pepper used to hash the refresh token secret.
refreshTokenHashPepper: pod.getPassword('jwtRefreshTokenHashPepper')!,
// Algorithm used to sign the tokens (`hmacSha512` or `ecdsaSha512`).
// Algorithm used to sign the tokens (`hmacSha512`, `hmacSha256` or `ecdsaSha512`).
algorithm: JwtAlgorithm.hmacSha512(
// Private key to sign the tokens. Must be a valid HMAC SHA-512 key.
SecretKey(pod.getPassword('jwtHmacSha512PrivateKey')!),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Finally, run `serverpod generate` to generate the client code and expose the end

#### Token Algorithms

There are two supported token algorithms:
There are three supported token algorithms:

- **HMAC SHA-512**: Use HMAC SHA-512 for symmetric key signing.

Expand All @@ -67,6 +67,14 @@ There are two supported token algorithms:
),
```

- **HMAC SHA-256**: Use HMAC SHA-256 for symmetric key signing.

```dart
algorithm: JwtAlgorithm.hmacSha256(
SecretKey(pod.getPassword('authenticationTokenPrivateKey')!),
),
```

- **ECDSA SHA-512**: Use ECDSA SHA-512 for asymmetric key signing.

```dart
Expand Down
Loading