Skip to content

Commit

Permalink
custom header at top level
Browse files Browse the repository at this point in the history
  • Loading branch information
jorg3lopez committed Oct 10, 2023
1 parent e793f17 commit f420a51
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
public class JjwtEngine implements AuthEngine {

private static final JjwtEngine INSTANCE = new JjwtEngine();
private static final String CUSTOM_HEADER = "eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0";

private JjwtEngine() {}

Expand Down Expand Up @@ -89,7 +90,7 @@ public LocalDateTime getExpirationDate(String jwt) {
var tokenOnly = jwt.substring(0, jwt.lastIndexOf('.') + 1);
var claimsOnly = tokenOnly.substring(tokenOnly.indexOf('.'));
// Passing jwt header with alg:None to satisfy jjwt expectations
var customHeaderAndClaims = "eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0" + claimsOnly;
var customHeaderAndClaims = CUSTOM_HEADER + claimsOnly;

Claims claims;
try {
Expand Down

0 comments on commit f420a51

Please sign in to comment.