Change SESSION to openAIRESession for redis Add openAIREUser and Remove Jwt from cookie

This commit is contained in:
Sofia Baltzi 2018-06-12 11:05:55 +00:00
parent 654dd85a2a
commit 21be3a4caf
2 changed files with 12 additions and 12 deletions

View File

@ -44,7 +44,7 @@ public class Config {
public CookieSerializer cookieSerializer() {
logger.info("Cookie Serializer: Domain is "+domain);
DefaultCookieSerializer serializer = new DefaultCookieSerializer();
serializer.setCookieName("SESSION"); // <1>
serializer.setCookieName("openAIRESession"); // <1>
serializer.setCookiePath("/"); // <2>
// serializer.setDomainNamePattern(""); //with value "" set's the domain of the service e.g scoobydoo.di.uoa.gr
serializer.setDomainName(domain);

View File

@ -29,18 +29,18 @@ public class FrontEndLinkURIAuthenticationSuccessHandler implements Authenticati
try {
Cookie jwt = new Cookie("XCsrfToken", JWTGenerator.generateToken(authOIDC, "my-very-secret"));
// Cookie openAIREUser = new Cookie("openAIREUser", new Gson().toJson(JWTGenerator.generateJsonToken(authOIDC)));
// Cookie jwt = new Cookie("XCsrfToken", JWTGenerator.generateToken(authOIDC, "my-very-secret"));
Cookie openAIREUser = new Cookie("openAIREUser", new Gson().toJson(JWTGenerator.generateJsonToken(authOIDC)));
Cookie accessToken = new Cookie("AccessToken", authOIDC.getAccessTokenValue());
// Expire the cookies in four hours (4 * 3600)
jwt.setMaxAge(14400);
// openAIREUser.setMaxAge(14400);
// jwt.setMaxAge(14400);
openAIREUser.setMaxAge(14400);
accessToken.setMaxAge(14400);
//TODO DELETE LOG
logger.info("\n////////////////////////////////////////////////////////////////////////////////////////////////\n");
logger.info("jwt: " + JWTGenerator.generateToken(authOIDC, "my-very-secret"));
// logger.info("jwt: " + JWTGenerator.generateToken(authOIDC, "my-very-secret"));
logger.info("access token: " + authOIDC.getAccessTokenValue());
logger.info("openAIREUser: " + JWTGenerator.generateJsonToken(authOIDC));
logger.info("\n////////////////////////////////////////////////////////////////////////////////////////////////\n");
@ -51,18 +51,18 @@ public class FrontEndLinkURIAuthenticationSuccessHandler implements Authenticati
// logger.info("\n////////////////////////////////////////////////////////////////////////////////////////////////\n");
jwt.setPath(frontPath);
// openAIREUser.setPath(frontPath);
// jwt.setPath(frontPath);
openAIREUser.setPath(frontPath);
accessToken.setPath(frontPath);
if (frontDomain!=null) {
jwt.setDomain(frontDomain);
// openAIREUser.setDomain(frontDomain);
// jwt.setDomain(frontDomain);
openAIREUser.setDomain(frontDomain);
accessToken.setDomain(frontDomain);
}
response.addCookie(jwt);
// response.addCookie(openAIREUser);
// response.addCookie(jwt);
response.addCookie(openAIREUser);
response.addCookie(accessToken);
response.sendRedirect(frontEndURI);