Skip to content

Commit 22a5270

Browse files
authored
Merge pull request auth0#286 from qaemma/fix-doc-JwkStore
Improve README for the Using KeyProvider example
2 parents a2e6c64 + 2258495 commit 22a5270

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ By using a `KeyProvider` you can change in runtime the key used either to verify
7474
- `getPrivateKeyId()`: Its called during token signing and it should return the id of the key that identifies the one returned by `getPrivateKey()`. This value is preferred over the one set in the `JWTCreator.Builder#withKeyId(String)` method. If you don't need to set a `kid` value avoid instantiating an Algorithm using a `KeyProvider`.
7575

7676

77-
The following snippet uses example classes showing how this would work:
78-
77+
The following example shows how this would work with `JwkStore`, an imaginary [JWK Set](https://auth0.com/docs/jwks) implementation. For simple key rotation using JWKS, try the [jwks-rsa-java](https://github.com/auth0/jwks-rsa-java) library.
7978

8079
```java
8180
final JwkStore jwkStore = new JwkStore("{JWKS_FILE_HOST}");
@@ -105,9 +104,6 @@ Algorithm algorithm = Algorithm.RSA256(keyProvider);
105104
//Use the Algorithm to create and verify JWTs.
106105
```
107106

108-
> For simple key rotation using JWKs try the [jwks-rsa-java](https://github.com/auth0/jwks-rsa-java) library.
109-
110-
111107
### Create and Sign a Token
112108

113109
You'll first need to create a `JWTCreator` instance by calling `JWT.create()`. Use the builder to define the custom Claims your token needs to have. Finally to get the String token call `sign()` and pass the `Algorithm` instance.

0 commit comments

Comments
 (0)