Skip to content

Commit

Permalink
ready for draft
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Crawford <[email protected]>
  • Loading branch information
stephen-crawford committed Nov 23, 2022
1 parent 70cac07 commit 6e04abc
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -675,14 +675,14 @@ public void testRestRequestAuthenticationFailure() {
Map<String, Object> jwtClaims = new HashMap<>();
jwtClaims.put("sub", "testSubject");

String encodedToken = JwtVendor.createJwt(jwtClaims);
String encodedToken = JwtVendor.createExpiredJwt(jwtClaims);

String headerBody = "Bearer " + encodedToken;

final ThreadContext threadContext = client.threadPool().getThreadContext();

final FakeRestRequest fakeRestRequest = new FakeRestRequest.Builder(NamedXContentRegistry.EMPTY).withHeaders(
Collections.singletonMap("Authorization", Collections.singletonList(headerBody)) //TODO: Switch to invalid JWT once figure out how to create one
Collections.singletonMap("Authorization", Collections.singletonList(headerBody)) //Expired so is invalid
)
.build();

Expand Down

0 comments on commit 6e04abc

Please sign in to comment.