dashboard #6

Merged
v4l3n71n merged 27 commits from dashboard into master 2022-08-25 21:30:04 +00:00
Showing only changes of commit ea34ae37c0 - Show all commits

View File

@ -42,6 +42,7 @@ public class TokenRessource {
@GET @GET
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public Response tokenRefresh(@HeaderParam("Authorization") String auth, @CookieParam("user") String user, @CookieParam("jwt") String jwtCookie) { public Response tokenRefresh(@HeaderParam("Authorization") String auth, @CookieParam("user") String user, @CookieParam("jwt") String jwtCookie) {
final int expires = 300;
String name = "anonymous"; String name = "anonymous";
String password = ""; String password = "";
if(auth == null){ if(auth == null){
@ -71,7 +72,7 @@ public class TokenRessource {
// or create a JWT token encrypted using the 'A256KW' algorithm // or create a JWT token encrypted using the 'A256KW' algorithm
// Jwt.upn("alice").encryptWithSecret(secret); // Jwt.upn("alice").encryptWithSecret(secret);
String nameEncoded = Base64.toBase64String(name.getBytes(StandardCharsets.UTF_8)); String nameEncoded = Base64.toBase64String(name.getBytes(StandardCharsets.UTF_8));
return Response.status(Response.Status.CREATED).cookie(new NewCookie(new Cookie("jwt", newJwtCookie), "Token JWT", 300, false), new NewCookie(new Cookie("user", nameEncoded), "Username", 60, false)).build(); return Response.status(Response.Status.CREATED).cookie(new NewCookie(new Cookie("jwt", newJwtCookie), "Token JWT", expires, false), new NewCookie(new Cookie("user", nameEncoded), "Username", expires, false)).build();
} }
// All mp.jwt and smallrye.jwt properties are still effective, only the verification key is customized. // All mp.jwt and smallrye.jwt properties are still effective, only the verification key is customized.
try { try {