From 42d43e6a85eaeada3ac4af99ce7cf3cac9cddb0b Mon Sep 17 00:00:00 2001 From: Sofia Baltzi <> Date: Mon, 21 May 2018 15:48:31 +0000 Subject: [PATCH] Add RequestToDelete page and Fix css --- ...ndLinkURIAuthenticationSuccessHandler.java | 19 ++++++++------- .../usermanagement/security/JWTGenerator.java | 6 ++--- .../usermanagement/utils/UrlConstructor.java | 3 +++ src/main/webapp/WEB-INF/web.xml | 24 +++++++++++++++++++ src/main/webapp/css/aai-custom.css | 12 ++++++++++ src/main/webapp/error404.jsp | 8 +++---- src/main/webapp/requestActivationCode.jsp | 2 +- 7 files changed, 58 insertions(+), 16 deletions(-) diff --git a/src/main/java/eu/dnetlib/openaire/usermanagement/security/FrontEndLinkURIAuthenticationSuccessHandler.java b/src/main/java/eu/dnetlib/openaire/usermanagement/security/FrontEndLinkURIAuthenticationSuccessHandler.java index e299f3f..5638f3a 100644 --- a/src/main/java/eu/dnetlib/openaire/usermanagement/security/FrontEndLinkURIAuthenticationSuccessHandler.java +++ b/src/main/java/eu/dnetlib/openaire/usermanagement/security/FrontEndLinkURIAuthenticationSuccessHandler.java @@ -30,19 +30,19 @@ 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 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); +// openAIREUser.setMaxAge(14400); accessToken.setMaxAge(14400); //TODO DELETE LOG logger.info("\n////////////////////////////////////////////////////////////////////////////////////////////////\n"); logger.info("jwt: " + JWTGenerator.generateToken(authOIDC, "my-very-secret")); logger.info("access token: " + authOIDC.getAccessTokenValue()); - // logger.info("openAIREUser: " + JWTGenerator.generateJsonToken(authOIDC)); + logger.info("openAIREUser: " + JWTGenerator.generateJsonToken(authOIDC)); logger.info("\n////////////////////////////////////////////////////////////////////////////////////////////////\n"); //TODO DELETE LOG @@ -52,14 +52,17 @@ public class FrontEndLinkURIAuthenticationSuccessHandler implements Authenticati jwt.setPath(frontPath); - if (frontDomain!=null) jwt.setDomain(frontDomain); - // openAIREUser.setPath(frontPath); - // if (frontDomain!=null) openAIREUser.setDomain(frontDomain); +// openAIREUser.setPath(frontPath); accessToken.setPath(frontPath); - if (frontDomain!=null) accessToken.setDomain(frontDomain); + + if (frontDomain!=null) { + jwt.setDomain(frontDomain); +// openAIREUser.setDomain(frontDomain); + accessToken.setDomain(frontDomain); + } response.addCookie(jwt); - // response.addCookie(openAIREUser); +// response.addCookie(openAIREUser); response.addCookie(accessToken); response.sendRedirect(frontEndURI); diff --git a/src/main/java/eu/dnetlib/openaire/usermanagement/security/JWTGenerator.java b/src/main/java/eu/dnetlib/openaire/usermanagement/security/JWTGenerator.java index 2155979..dc7c2b5 100644 --- a/src/main/java/eu/dnetlib/openaire/usermanagement/security/JWTGenerator.java +++ b/src/main/java/eu/dnetlib/openaire/usermanagement/security/JWTGenerator.java @@ -61,8 +61,8 @@ public class JWTGenerator { } else { claims.put("lastname", URLEncoder.encode(authOIDC.getUserInfo().getFamilyName(), "UTF-8") + ""); } - claims.put("email", authOIDC.getUserInfo().getEmail() + ""); -// claims.put("role", URLEncoder.encode(userInfo.getAsJsonArray("edu_person_entitlements").toString(), "UTF-8") + ""); +// claims.put("email", authOIDC.getUserInfo().getEmail() + ""); + claims.put("role", URLEncoder.encode(userInfo.getAsJsonArray("edu_person_entitlements").toString(), "UTF-8") + ""); // // if (userInfo.getAsJsonArray("eduPersonScopedAffiliation").toString() != null) { @@ -72,7 +72,7 @@ public class JWTGenerator { if (userInfo.getAsJsonArray("edu_person_entitlements") == null){ logger.info("User: " + authOIDC.getUserInfo().getName() + "doesn't have role"); claims.put("role", URLEncoder.encode(" ", "UTF-8") + ""); -//s claims.put("role", ""); +// claims.put("role", ""); } else { claims.put("role", URLEncoder.encode(userInfo.getAsJsonArray("edu_person_entitlements").toString(), "UTF-8") + ""); } diff --git a/src/main/java/eu/dnetlib/openaire/usermanagement/utils/UrlConstructor.java b/src/main/java/eu/dnetlib/openaire/usermanagement/utils/UrlConstructor.java index 0c4a229..52ea59e 100644 --- a/src/main/java/eu/dnetlib/openaire/usermanagement/utils/UrlConstructor.java +++ b/src/main/java/eu/dnetlib/openaire/usermanagement/utils/UrlConstructor.java @@ -35,6 +35,9 @@ public class UrlConstructor { if (jspPage.equals("successAddPassword.jsp")) { request.getSession().setAttribute("successAddPassword", "true"); } + if (jspPage.equals("successDeleteAccount.jsp")) { + request.getSession().setAttribute("successDeleteAccount", "true"); + } if (jspPage.equals("expiredVerificationCode.jsp")) { request.getSession().setAttribute("expiredVerificationCode", "true"); } diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 7f8d519..dfaa75b 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -118,6 +118,30 @@ /requestActivationCode + + RequestToDeleteAccountServlet + Request to delete an account + eu.dnetlib.openaire.usermanagement.RequestToDeleteAccountServlet + 1 + + + + RequestToDeleteAccountServlet + /requestToDeleteAccount + + + + VerifyToDeletServlet + Verify to delete an account + eu.dnetlib.openaire.usermanagement.VerifyToDeleteServlet + 1 + + + + VerifyToDeletServlet + /verifyToDelete + + CorsFilter diff --git a/src/main/webapp/css/aai-custom.css b/src/main/webapp/css/aai-custom.css index ae5422f..34fda92 100644 --- a/src/main/webapp/css/aai-custom.css +++ b/src/main/webapp/css/aai-custom.css @@ -7,3 +7,15 @@ h6, .aai-h6 { text-transform: initial !important; font-variant: small-caps; } + +.custom-footer { + position: relative; + bottom: 0; + left: 0; + right: 0; +} + + +#tm-main { + min-height: 80vh; +} \ No newline at end of file diff --git a/src/main/webapp/error404.jsp b/src/main/webapp/error404.jsp index 6fd57dd..c95426a 100644 --- a/src/main/webapp/error404.jsp +++ b/src/main/webapp/error404.jsp @@ -29,18 +29,18 @@
-
+
-
+
<%--

Welcome to our Single Sign-On service

--%> <%--
Use the same credentials for all our services
--%>
-

404 - Oops! Something went wrong!

+

404 - Oops! Something went wrong!

-

404 Error! The requested page is not found.

+

404 Error! The requested page was not found.

diff --git a/src/main/webapp/requestActivationCode.jsp b/src/main/webapp/requestActivationCode.jsp index 57bc524..76e546d 100644 --- a/src/main/webapp/requestActivationCode.jsp +++ b/src/main/webapp/requestActivationCode.jsp @@ -44,7 +44,7 @@
-

Request an Activation Code

+

Request an activation code