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
Returns the Algorithm value or null if it's not defined in the Header.
151
+
152
+
```java
153
+
String algorithm = jwt.getAlgorithm();
154
+
```
155
+
156
+
#### Type ("typ")
157
+
158
+
Returns the Type value or null if it's not defined in the Header.
159
+
160
+
```java
161
+
String type = jwt.getType();
162
+
```
163
+
164
+
#### Content Type ("cty")
165
+
166
+
Returns the Content Type value or null if it's not defined in the Header.
167
+
168
+
```java
169
+
String contentType = jwt.getContentType();
170
+
```
171
+
172
+
#### Key Id ("kid")
173
+
174
+
Returns the Key Id value or null if it's not defined in the Header.
175
+
176
+
```java
177
+
String keyId = jwt.getKeyId();
178
+
```
179
+
180
+
#### Private Claims
181
+
182
+
Additional Claims defined in the token's Header can be obtained by calling `getHeaderClaim()` and passing the Claim name. A Claim will always be returned, even if it can't be found. You should always check for null values.
183
+
184
+
```java
185
+
Claim claim = jwt.getHeaderClaim("owner");
186
+
```
187
+
188
+
189
+
### Payload Claims
152
190
153
191
#### Issuer ("iss")
154
192
155
-
Returns the Issuer value or null if it's not defined.
193
+
Returns the Issuer value or null if it's not defined in the Payload.
156
194
157
195
```java
158
196
String issuer = jwt.getIssuer();
159
197
```
160
198
161
199
#### Subject ("sub")
162
200
163
-
Returns the Subject value or null if it's not defined.
201
+
Returns the Subject value or null if it's not defined in the Payload.
164
202
165
203
```java
166
204
String subject = jwt.getSubject();
167
205
```
168
206
169
207
#### Audience ("aud")
170
208
171
-
Returns the Audience value in or null if it's not defined.
209
+
Returns the Audience value in or null if it's not defined in the Payload.
172
210
173
211
```java
174
212
String[] audience = jwt.getAudience();
175
213
```
176
214
177
215
#### Expiration Time ("exp")
178
216
179
-
Returns the Expiration Time value or null if it's not defined.
217
+
Returns the Expiration Time value or null if it's not defined in the Payload.
180
218
181
219
```java
182
220
Date expiresAt = jwt.getExpiresAt();
183
221
```
184
222
185
223
#### Not Before ("nbf")
186
224
187
-
Returns the Not Before value or null if it's not defined.
225
+
Returns the Not Before value or null if it's not defined in the Payload.
188
226
189
227
```java
190
228
Date notBefore = jwt.getNotBefore();
191
229
```
192
230
193
231
#### Issued At ("iat")
194
232
195
-
Returns the Issued At value or null if it's not defined.
233
+
Returns the Issued At value or null if it's not defined in the Payload.
196
234
197
235
```java
198
236
Date issuedAt = jwt.getIssuedAt();
199
237
```
200
238
201
239
#### JWT ID ("jti")
202
240
203
-
Returns the JWT ID value or null if it's not defined.
241
+
Returns the JWT ID value or null if it's not defined in the Payload.
204
242
205
243
```java
206
244
String id = jwt.getId();
207
245
```
208
246
209
-
### Private Claims
247
+
####Private Claims
210
248
211
-
Additional Claims defined in the token can be obtained by calling `getClaim()` and passing the Claim name. A Claim will always be returned, even if it can't be found. You should always check for null values.
249
+
Additional Claims defined in the token's Payload can be obtained by calling `getClaim()` and passing the Claim name. A Claim will always be returned, even if it can't be found. You should always check for null values.
0 commit comments