diff --git a/src/main/java/eu/dnetlib/openaire/usermanagement/PersonalTokenServlet.java b/src/main/java/eu/dnetlib/openaire/usermanagement/PersonalTokenServlet.java index 787203d..0477e4f 100644 --- a/src/main/java/eu/dnetlib/openaire/usermanagement/PersonalTokenServlet.java +++ b/src/main/java/eu/dnetlib/openaire/usermanagement/PersonalTokenServlet.java @@ -53,12 +53,15 @@ public class PersonalTokenServlet extends HttpServlet { throws ServletException, IOException { response.setContentType("text/html"); OIDCAuthenticationToken authentication = (OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication(); + StringBuilder name = new StringBuilder().append(authentication.getUserInfo().getGivenName().charAt(0)); + name.append(authentication.getUserInfo().getFamilyName().charAt(0)); + request.getSession().setAttribute("name", name.toString()); request.getSession().setAttribute("accessToken", authentication.getAccessTokenValue()); request.getSession().setAttribute("refreshToken", authentication.getRefreshTokenValue()); request.getRequestDispatcher("./personal.jsp").include(request, response); } - public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { + public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { OIDCAuthenticationToken authentication = (OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication(); String refreshToken = authentication.getRefreshTokenValue(); List oldRefreshTokens = null; @@ -71,7 +74,7 @@ public class PersonalTokenServlet extends HttpServlet { logger.error("Error deleting old refresh tokens.", e); //TODO should I let user know? } - request.setAttribute("display_refresh_token", "display:block"); + request.getSession().setAttribute("showRefreshToken", true); response.sendRedirect("./personalToken"); } diff --git a/src/main/webapp/css/aai-custom.css b/src/main/webapp/css/aai-custom.css index 68429eb..b0b8af5 100644 --- a/src/main/webapp/css/aai-custom.css +++ b/src/main/webapp/css/aai-custom.css @@ -1,11 +1,16 @@ -.aai-form-danger,.aai-form-danger:focus { - color:#f0506e; - border-color:#f0506e +:root { + --primary-color: #222080; + --secondary-color: #4686E5; +} + +.aai-form-danger, .aai-form-danger:focus { + color: #f0506e; + border-color: #f0506e } h6, .aai-h6 { - text-transform: initial !important; - font-variant: small-caps; + text-transform: initial !important; + font-variant: small-caps; } .custom-footer { @@ -24,14 +29,21 @@ h6, .aai-h6 { .uk-navbar-nav > li > a::before { background-color: transparent !important; } -.login svg{ - fill: #222080; + +.login svg { + fill: var(--primary-color); } + +.login:hover circle { + fill: var(--secondary-color); +} + .login text { stroke: #fff; fill: #fff; font-weight: 400; } -a:hover, .uk-link:hover{ + +a:hover, .uk-link:hover { color: #222080; } \ No newline at end of file diff --git a/src/main/webapp/header.jsp b/src/main/webapp/header.jsp new file mode 100644 index 0000000..5bc0954 --- /dev/null +++ b/src/main/webapp/header.jsp @@ -0,0 +1,52 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +
+
+ +
+
diff --git a/src/main/webapp/personal.jsp b/src/main/webapp/personal.jsp index 9da4791..0a1f465 100644 --- a/src/main/webapp/personal.jsp +++ b/src/main/webapp/personal.jsp @@ -1,203 +1,207 @@ -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> - - - - OpenAIRE - Personal token - - - - - - - - - - - + + + + OpenAIRE - Personal token + + + + + + + + + + + -
- - -
-
- -
-
- - +
+
-
-
+
+
-
-
-
-
API Access
-
-
- -
-
- ${message} - -
- - -
Your personal access token is
-
${accessToken}
- Your access token is valid for an hour. -
-
- -
-

Do not share your personal access token. Send your personal access token only over HTTPS.

-
-
- For further information on how to use the tokens please visit the OpenAIRE API Authentication documentation. -
- -
- -
Do you need a refresh token?
-

OpenAIRE refresh token expires after 1 month and allows you to programmatically get a new access token.

- -
- -
- Please copy your refresh token and store it confidentially. You will not be able to retrieve it.
-
-

Do not share your refresh token. Send your personal access token only over HTTPS.

-
- -
${refreshToken}
-
- - -
-
-
-

Get refresh token

-

In case you already have a refresh token, it will no longer be valid. Do you want to proceed?

-

- - -

+ +
+
+ ${message} + +
+ + + For further information on how to use the tokens please visit the + OpenAIRE API Authentication documentation. + +
+ + +

Your personal access token is

+
+
+
${accessToken}
+
+
+ + +
+
+
+ + + Your access token is valid for an hour. + +
+
+ + + Do not share your personal access token. Send your personal access token only over HTTPS. + +
-
-
+
+ + + +

Your refresh token is

+
+
+
${refreshToken}
+
+
+ + +
+
+
+ + OpenAIRE refresh token expires after 1 month and allows you to programmatically get a new access token. +
+
+ +
+
Please copy your refresh token and store it confidentially. You will not be able to retrieve it.
+
Do not share your refresh token. Send your refresh token only over HTTPS.
+
+
+
+ +

Do you need a refresh token?

+
+ + OpenAIRE refresh token expires after 1 month and allows you to programmatically get a new access token. +
+ +
+
- -
+
+ + +
+
+
+

Get refresh token

+

In case you already have a refresh token, it will no longer be valid. Do you want to + proceed?

+

+ + +

+
+
+
+
+ + +
-