mirror of https://github.com/jwtk/jjwt.git
Update README.md
This commit is contained in:
parent
1be528b58b
commit
ab83d8e5fa
|
@ -33,7 +33,7 @@ Random random = new SecureRandom();
|
|||
byte[] key = new byte[64];
|
||||
random.nextBytes(key);
|
||||
|
||||
String compactJwt = Jwts.builder().setIssuer("Me").setSubject("Joe").signWith(HS256, key).compact();
|
||||
String compactJwt = Jwts.builder().setSubject("Joe").signWith(HS256, key).compact();
|
||||
```
|
||||
|
||||
How easy was that!?
|
||||
|
@ -95,7 +95,7 @@ These feature sets will be implemented in a future release when possible. Commu
|
|||
This release adds convenience methods to the `JwtBuilder` interface so you can set claims directly on the builder without having to create a separate Claims instance/builder, reducing the amount of code you have to write. For example, this:
|
||||
|
||||
```java
|
||||
Claims claims = Jwts.claims().setIssuer("Me").setSubject("Joe");
|
||||
Claims claims = Jwts.claims().setSubject("Joe");
|
||||
|
||||
String compactJwt = Jwts.builder().setClaims(claims).signWith(HS256, key).compact();
|
||||
```
|
||||
|
@ -103,7 +103,7 @@ String compactJwt = Jwts.builder().setClaims(claims).signWith(HS256, key).compac
|
|||
can now be written as:
|
||||
|
||||
```java
|
||||
String compactJwt = Jwts.builder().setIssuer("Me").setSubject("Joe").signWith(HS256, key).compact();
|
||||
String compactJwt = Jwts.builder().setSubject("Joe").signWith(HS256, key).compact();
|
||||
```
|
||||
|
||||
A Claims instance based on the specified claims will be created and set as the JWT's payload automatically.
|
||||
|
|
Loading…
Reference in New Issue