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
147
190
148
191
#### Issuer ("iss")
149
192
150
-
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.
151
194
152
195
```java
153
196
String issuer = jwt.getIssuer();
154
197
```
155
198
156
199
#### Subject ("sub")
157
200
158
-
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.
159
202
160
203
```java
161
204
String subject = jwt.getSubject();
162
205
```
163
206
164
207
#### Audience ("aud")
165
208
166
-
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.
167
210
168
211
```java
169
212
String[] audience = jwt.getAudience();
170
213
```
171
214
172
215
#### Expiration Time ("exp")
173
216
174
-
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.
175
218
176
219
```java
177
220
Date expiresAt = jwt.getExpiresAt();
178
221
```
179
222
180
223
#### Not Before ("nbf")
181
224
182
-
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.
183
226
184
227
```java
185
228
Date notBefore = jwt.getNotBefore();
186
229
```
187
230
188
231
#### Issued At ("iat")
189
232
190
-
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.
191
234
192
235
```java
193
236
Date issuedAt = jwt.getIssuedAt();
194
237
```
195
238
196
239
#### JWT ID ("jti")
197
240
198
-
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.
199
242
200
243
```java
201
244
String id = jwt.getId();
202
245
```
203
246
204
-
### Private Claims
247
+
####Private Claims
205
248
206
-
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