Add RequestToDelete page and Fix css

This commit is contained in:
Sofia Baltzi 2018-05-21 15:48:31 +00:00
parent 4eb8263687
commit 42d43e6a85
7 changed files with 58 additions and 16 deletions

View File

@ -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);

View File

@ -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") + "");
}

View File

@ -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");
}

View File

@ -118,6 +118,30 @@
<url-pattern>/requestActivationCode</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>RequestToDeleteAccountServlet</servlet-name>
<display-name>Request to delete an account</display-name>
<servlet-class>eu.dnetlib.openaire.usermanagement.RequestToDeleteAccountServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>RequestToDeleteAccountServlet</servlet-name>
<url-pattern>/requestToDeleteAccount</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>VerifyToDeletServlet</servlet-name>
<display-name>Verify to delete an account</display-name>
<servlet-class>eu.dnetlib.openaire.usermanagement.VerifyToDeleteServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>VerifyToDeletServlet</servlet-name>
<url-pattern>/verifyToDelete</url-pattern>
</servlet-mapping>
<filter>
<filter-name>CorsFilter</filter-name>

View File

@ -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;
}

View File

@ -29,18 +29,18 @@
</div>
<!-- CONTENT STARTS HERE -->
<div class="first_page_section uk-section-default uk-section uk-padding-remove-vertical">
<div class="first_page_banner_headline uk-grid-collapse uk-flex-middle uk-margin-remove-vertical uk-grid">
<div class="first_page_banner_headline uk-grid-collapse uk-flex-middle uk-margin-remove-vertical uk-grid" uk-grid="">
</div>
</div>
<div class=" uk-section uk-margin-small-top tm-middle custom-main-content" id="tm-main">
<div class=" uk-section uk-margin-small-top tm-middle custom-main-content" id="tm-main">
<div class="uk-container uk-container-small uk-margin-medium-top uk-margin-small-bottom uk-text-center">
<%--<h2 class="uk-h2 uk-margin-small-bottom">Welcome to our Single Sign-On service</h2>--%>
<%--<div class="uk-text-meta uk-margin-large-bottom">Use the same credentials for all our services</div>--%>
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first uk-first-column">
<div class="uk-width-1-1">
<h3 class="uk-h3 uk-text-danger">404 - Oops! Something went wrong!</h3>
<h3 class="uk-h3 uk-text-danger ">404 - Oops! Something went wrong!</h3>
<div class="middle-box loginscreen animated fadeInDown uk-text-left ">
<p>404 Error! The requested page is not found.</p>
<p class="uk-text-center">404 Error! The requested page was not found.</p>
</div>
</div>

View File

@ -44,7 +44,7 @@
</div>
<div class=" uk-section uk-margin-small-top tm-middle custom-main-content" id="tm-main">
<div class="uk-container uk-container-small uk-margin-medium-top uk-margin-small-bottom uk-text-center">
<h2 class="uk-h2 uk-margin-small-bottom">Request an Activation Code</h2>
<h2 class="uk-h2 uk-margin-small-bottom">Request an activation code</h2>
<div uk-grid="" class="uk-grid uk-grid-stack">
<div class="tm-main uk-width-1-2@s uk-width-1-1@m uk-width-1-1@l uk-row-first uk-first-column uk-align-center">
<div class="uk-grid ">