Compare commits

...

8 Commits

46 changed files with 1406 additions and 4514 deletions

37
pom.xml
View File

@ -9,9 +9,8 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>dnet-openaire-users</artifactId>
<packaging>war</packaging>
<version>2.0.3-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<scm>
<connection>scm:git:gitea@code-repo.d4science.org:MaDgIK/dnet-openaire-users.git</connection>
<developerConnection>scm:git:gitea@code-repo.d4science.org:MaDgIK/dnet-openaire-users.git</developerConnection>
<url>https://code-repo.d4science.org/MaDgIK/dnet-openaire-users/</url>
@ -22,11 +21,6 @@
<artifactId>uoa-user-management</artifactId>
<version>[2.0.0-SNAPSHOT, 3.0.0)</version>
</dependency>
<dependency>
<groupId>eu.dnetlib</groupId>
<artifactId>uoa-login-core</artifactId>
<version>[1.0.0-SNAPSHOT, 2.0.0)</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
@ -57,6 +51,7 @@
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
</dependency>
<!-- About spring security -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
@ -72,6 +67,34 @@
<artifactId>spring-security-web</artifactId>
<version>4.2.1.RELEASE</version>
</dependency>
<!-- About redis -->
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
<version>1.3.1.RELEASE</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>biz.paluch.redis</groupId>
<artifactId>lettuce</artifactId>
<version>3.5.0.Final</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.mitre</groupId>
<artifactId>openid-connect-client</artifactId>
<version>1.3.0</version>
<exclusions>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>

View File

@ -1,70 +0,0 @@
package eu.dnetlib.openaire.usermanagement;
import com.google.gson.*;
import java.lang.reflect.Type;
public class JwksDeserializer implements JsonDeserializer<Jwks> {
@Override
public Jwks deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext)
throws JsonParseException {
JsonObject jsonObject = jsonElement.getAsJsonObject();
if (jsonObject == null) throw new JsonParseException("Jwks not valid.");
JsonArray jsonArray = jsonObject.getAsJsonArray("keys");
if (jsonArray == null ) throw new JsonParseException("Jwks not valid.");
Jwks jwks = new Jwks();
Key[] keys = new Key[jsonArray.size()];
Key key = null;
for (int i = 0; i < jsonArray.size(); i++) {
key = new Key();
JsonElement je = jsonArray.get(i);
if (je == null) throw new JsonParseException("Jwks not valid.");
if (je.getAsJsonObject().get("kty")==null) throw new JsonParseException("Jwks not valid.");
key.setKty(je.getAsJsonObject().get("kty").getAsString());
if (je.getAsJsonObject().get("e")==null) throw new JsonParseException("Jwks not valid.");
key.setE(je.getAsJsonObject().get("e").getAsString());
if (je.getAsJsonObject().get("kid")==null) throw new JsonParseException("Jwks not valid.");
key.setKid(je.getAsJsonObject().get("kid").getAsString());
if (je.getAsJsonObject().get("alg")==null) throw new JsonParseException("Jwks not valid.");
key.setAlg(je.getAsJsonObject().get("alg").getAsString());
if (je.getAsJsonObject().get("n")==null) throw new JsonParseException("Jwks not valid.");
key.setN(je.getAsJsonObject().get("n").getAsString());
keys[i] = key;
}
jwks.setKeys(keys);
return jwks;
}
}
/*
public static void main(String[] args) {
Gson gson = new GsonBuilder().registerTypeAdapter(Jwks.class, new JwksDeserializer()).create();
String jwksJson = "{\n" +
" \"keys\": [\n" +
" {\n" +
" \"kty\": \"RSA\",\n" +
" \"e\": \"AQAB\",\n" +
" \"kid\": \"05794a3c-a6f5-430c-9822-da4e53597ba5\",\n" +
" \"alg\": \"RS256\",\n" +
" \"n\": \"hm_OUny05OJEwbGBqPjE7wWvnwTMgqUHJFis_S9nM7hTivXQ_LX9f89RaVcPpXboox81Y8rrfuVwV0nc-FGr_E0FFpI-IwJ_sUUEDwf-5Qxor3LNc_S_5BiPOfFHY7c-R-ablRIAvVTXqwIjcyLVQnaHLjb9XQPf9lBt9sCZ2jN-9HOLztMO3BZWZYIFqvNr8ySKHfVPdlk0Wx3N45KPY0kgxk5RPYW0HLRakSlhIJtqYCJOr2IiDUEMAj9Z9BoWjeUKiAX3E3ZRo-DO1TWcc7feq-0Pei2IBw3lvNpgcBBv1_BlrsZYzQqkKOcDbLAppuhR3inUNhc3G67OuWt8ow\"\n" +
" }\n" +
" ]\n" +
"}";
Jwks jwks = gson.fromJson(jwksJson, Jwks.class);
for(Key key:jwks.getKeys()) {
//System.out.println(key.getE());
}
}
}
*/

View File

@ -1,9 +1,9 @@
package eu.dnetlib.openaire.usermanagement;
import org.mitre.openid.connect.model.OIDCAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@ -12,22 +12,16 @@ import java.io.IOException;
public class OverviewServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
@Value("${developers.url}")
private String url;
boolean isAuthenticated = !SecurityContextHolder.getContext().getAuthentication().getPrincipal().toString()
.equals("anonymousUser");
public void init(ServletConfig config) throws ServletException {
super.init(config);
SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this,
config.getServletContext());
}
if (isAuthenticated) {
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("authenticated", isAuthenticated);
request.getSession().setAttribute("name", name.toString());
}
response.setContentType("text/html");
request.getRequestDispatcher("./overview.jsp").include(request, response);
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
response.sendRedirect(url + "/");
}
}

View File

@ -1,19 +1,6 @@
package eu.dnetlib.openaire.usermanagement;
import com.google.gson.Gson;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpHeaders;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.log4j.Logger;
import org.mitre.openid.connect.client.service.impl.StaticClientConfigurationService;
import org.mitre.openid.connect.model.OIDCAuthenticationToken;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;
import javax.servlet.ServletConfig;
@ -22,25 +9,11 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
public class PersonalTokenServlet extends HttpServlet {
@Value("${oidc.secret}")
private String secret;
@Value("${oidc.id}")
private String id;
@Value("${oidc.issuer}")
private String issuer;
@Autowired
private StaticClientConfigurationService staticClientConfigurationService;
private Logger logger = Logger.getLogger(PersonalTokenServlet.class);
@Value("${developers.url}")
private String url;
public void init(ServletConfig config) throws ServletException {
super.init(config);
@ -48,69 +21,7 @@ public class PersonalTokenServlet extends HttpServlet {
config.getServletContext());
}
public void doGet(HttpServletRequest request, HttpServletResponse response)
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 doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
response.sendRedirect(url + "/personal-token");
}
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
OIDCAuthenticationToken authentication = (OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication();
String refreshToken = authentication.getRefreshTokenValue();
List<String> oldRefreshTokens = null;
try {
oldRefreshTokens = getOldRefreshTokens(authentication.getRefreshTokenValue(), authentication.getAccessTokenValue());
deleteOldRefreshTokens(oldRefreshTokens, authentication.getAccessTokenValue());
} catch (IOException e) {
logger.error("Error deleting old refresh tokens.", e);
//TODO should I let user know?
}
request.getSession().setAttribute("showRefreshToken", true);
response.sendRedirect("./personalToken");
}
private void deleteOldRefreshTokens(List<String> oldRefreshTokens, String accessToken) throws IOException {
HttpDelete httpDelete;
CloseableHttpClient httpclient = HttpClients.createDefault();
for (String refreshTokenId:oldRefreshTokens) {
httpDelete = new HttpDelete(issuer + "/api/tokens/refresh/" + refreshTokenId);
httpDelete.setHeader(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken);
HttpResponse response = httpclient.execute(httpDelete);
if (response.getStatusLine().getStatusCode()!=200) {
logger.warn("Could not delete old refresh tokens." + response.getStatusLine().getStatusCode());
//System.out.println("Could not delete old refresh tokens." + response.getStatusLine().getStatusCode());//TODO should I throw exception?
}
}
}
private List<String> getOldRefreshTokens(String currentRefreshToken, String accessToken) throws IOException {
HttpGet httpGet = new HttpGet(issuer + "/api/tokens/refresh");
httpGet.setHeader(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken);
CloseableHttpClient httpclient = HttpClients.createDefault();
String jsonResponse = IOUtils.toString(httpclient.execute(httpGet).getEntity().getContent(), StandardCharsets.UTF_8.name());
Gson gson = new Gson();
List<String> oldRefreshTokens = null;
for(RefreshToken refreshToken:gson.fromJson(jsonResponse, RefreshToken[].class)){
if (oldRefreshTokens == null) {
oldRefreshTokens = new ArrayList<>();
}
if (!refreshToken.getValue().equals(currentRefreshToken)) {
oldRefreshTokens.add(refreshToken.getId()+"");
}
}
return oldRefreshTokens;
}
}
}

View File

@ -1,58 +0,0 @@
package eu.dnetlib.openaire.usermanagement;
public class RefreshToken {
private String value;
private int id;
private String[] scopes;
private String clientId;
private String userId;
private String expliration;
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String[] getScopes() {
return scopes;
}
public void setScopes(String[] scopes) {
this.scopes = scopes;
}
public String getClientId() {
return clientId;
}
public void setClientId(String clientId) {
this.clientId = clientId;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getExpliration() {
return expliration;
}
public void setExpliration(String expliration) {
this.expliration = expliration;
}
}

View File

@ -1,18 +1,6 @@
package eu.dnetlib.openaire.usermanagement;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonParseException;
import eu.dnetlib.openaire.user.pojos.RegisteredService;
import eu.dnetlib.openaire.usermanagement.utils.RegisteredServicesUtils;
import eu.dnetlib.openaire.usermanagement.utils.TokenUtils;
import org.apache.commons.validator.routines.UrlValidator;
import org.apache.http.HttpResponse;
import org.apache.log4j.Logger;
import org.mitre.openid.connect.model.OIDCAuthenticationToken;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.method.P;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;
import javax.servlet.ServletConfig;
@ -21,12 +9,12 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.SQLException;
public class RegisterServiceServlet extends HttpServlet {
private Logger logger = Logger.getLogger(RegisterServiceServlet.class);
@Value("${developers.url}")
private String url;
public void init(ServletConfig config) throws ServletException {
super.init(config);
@ -34,394 +22,7 @@ public class RegisterServiceServlet extends HttpServlet {
config.getServletContext());
}
@Autowired
private RegisteredServicesUtils registeredServicesUtils;
@Autowired
private TokenUtils tokenUtils;
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
OIDCAuthenticationToken authentication = (OIDCAuthenticationToken) SecurityContextHolder.
getContext().getAuthentication();
String userid = authentication.getSub();
StringBuilder name = new StringBuilder().append(authentication.getUserInfo().getGivenName().charAt(0));
name.append(authentication.getUserInfo().getFamilyName().charAt(0));
request.getSession().setAttribute("name", name.toString());
String idParam = request.getParameter("id");
if (idParam != null && !idParam.isEmpty()) { // EDIT CASE
//System.out.println("In edit");
try {
int id = Integer.parseInt(idParam);
RegisteredService registeredService = registeredServicesUtils.getRegisteredServiceDao().fetchRegisteredServiceById(id);
if (registeredService != null && registeredServicesUtils.isAuthorized(userid, id)) {
ServiceResponse serviceResponse = tokenUtils.getRegisteredService(registeredService.getClientId(), registeredService.getRegistrationAccessToken());
updateFormFields(request, registeredService.getName(), registeredService.getKeyType(), serviceResponse);
} else {
if (registeredService == null) {
//System.out.println("No service found!");
request.getSession().setAttribute("message", "Not valid registered service with given id " + id + ".");
response.sendRedirect("./registeredServices");
logger.warn("Not valid registered service with " + id + "id.");
} else {
//System.out.println("Not authorized");
request.getSession().setAttribute("message", "Not authorized to edit the registered service with id " + id + ".");
response.sendRedirect("./registeredServices");
logger.warn("Not authorized to edit the service with " + id + "id.");
}
}
} catch (NumberFormatException nfe) {
//System.out.println("WRONG FORMAT");
request.getSession().setAttribute("message", "Invalid service id.");
response.sendRedirect("./registeredServices");
logger.error("Invalid service id.", nfe);
} catch (SQLException sqle) {
//System.out.println("SQL PROBLEM");
request.getSession().setAttribute("message", "Could not fetch registered service.");
response.sendRedirect("./registeredServices");
logger.error("Could not fetch registered service.", sqle);
}
} else {// NEW SERVICE CASE
//Careful! Redirects in method
request.getSession().setAttribute("first_name", null);
request.getSession().setAttribute("key_type", null);
request.getSession().setAttribute("jwksUri", null);
request.getSession().setAttribute("value", null);
checkNumberOfRegisteredServices(request, response, authentication);
}
response.setContentType("text/html");
request.getRequestDispatcher("./registerService.jsp").include(request, response);
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
response.sendRedirect(url + "/apis");
}
private void updateFormFields(HttpServletRequest request, String serviceName, String keyType, ServiceResponse serviceResponse) {
//System.out.println("UPDATING FORM");
request.getSession().setAttribute("first_name", serviceName);
//System.out.println("Service response URI " + serviceResponse.getJwksUri());
request.getSession().setAttribute("key_type", keyType);
if (keyType != null) {
if (keyType.equals("uri")) {
request.getSession().setAttribute("jwksUri", serviceResponse.getJwksUri());
} else {
Key key;
if (serviceResponse.getJwks() != null) {
key = serviceResponse.getJwks().keys[0];
} else {
key = new Key();
}
//System.out.println("Service response keys " + serviceResponse.getJwksUri());
Gson gson = new GsonBuilder().setPrettyPrinting().create();
request.getSession().setAttribute("value", gson.toJson(key));
}
}
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
OIDCAuthenticationToken authentication = (OIDCAuthenticationToken) SecurityContextHolder.
getContext().getAuthentication();
response.setContentType("text/html");
boolean canProceed = true;
String mode = request.getParameter("mode").trim();
//System.out.println("Mode was " + mode);
checkmode(mode);
//System.out.println("Mode is " + mode);
String serviceId = request.getParameter("id");
String name = request.getParameter("first_name").trim();
if (name.isEmpty()) {
request.getSession().setAttribute("first_name_error", true);
canProceed = false;
}
String keyType = request.getParameter("key_type");
String jwksUri = null;
String jwksString = null;
Jwks jwks = null;
if(keyType != null) {
keyType = keyType.trim();
if (keyType.equals("uri")) {
jwksUri = request.getParameter("uri");
request.getSession().setAttribute("jwksUri", jwksUri);
String[] schemes = {"https"};
UrlValidator urlValidator = new UrlValidator(schemes);
if (!urlValidator.isValid(jwksUri)) {
request.getSession().setAttribute("uri_error", true);
canProceed = false;
}
} else {
jwksString = request.getParameter("value");
try {
Gson gson = new GsonBuilder().registerTypeAdapter(Jwks.class, new JwksDeserializer()).create();
String jwksSet = String.format("{\"keys\":[%s]}", jwksString);
jwks = gson.fromJson(jwksSet, Jwks.class);
request.getSession().setAttribute("value", jwksString);
if (jwks.getKeys() == null || jwks.getKeys().length == 0) {
//System.out.println("Something wrong with the keys.");
request.getSession().setAttribute("value_error", true);
canProceed = false;
}
} catch (JsonParseException jpe) {
request.getSession().setAttribute("value_error", true);
canProceed = false;
}
}
}
String userid = authentication.getSub();
String email = authentication.getUserInfo().getEmail();
ServiceResponse serviceResponse = null;
if (nameIsValid(name) && userInfoIsValid(userid, email) && keyIsValid(keyType, jwksUri, jwksString) && canProceed) {
String serverMessage;
if (mode.equals("create")) {
//Careful! Redirects in method
if (!checkNumberOfRegisteredServices(request, response, authentication)) {
return;
}
String serverRequestJSON = null;
if(keyType == null) {
serverRequestJSON = createServiceJson(null, name, email);
} else if (keyType.equals("uri")) {
serverRequestJSON = createServiceJson(null, name, email, jwksUri);
} else if (keyType.equals("value")){
serverRequestJSON = createServiceJson(null, name, email, jwks);
}
if(serverRequestJSON != null) {
//System.out.println("SERVER JSON " + serverRequestJSON);
serverMessage = tokenUtils.registerService(serverRequestJSON);
logger.debug(serverMessage);
if (serverMessage == null) {
request.getSession().setAttribute("message", "There was an error registering your service. Please try again later.");
response.sendRedirect("./registeredServices");
return;
}
serviceResponse = new Gson().fromJson(serverMessage, ServiceResponse.class);
String client_id = serviceResponse.getClientId();
RegisteredService registeredService = new RegisteredService(client_id, userid, name, serviceResponse.getRegistrationAccessToken(), keyType);
try {
registeredServicesUtils.addRegistedService(registeredService);
if(registeredService.getKeyType() != null) {
request.getSession().setAttribute("success",
"Your service has been successfully registered!<br>" +
"<b>Client ID</b>: " + serviceResponse.getClientId());
} else {
request.getSession().setAttribute("success",
"Your service has been successfully registered!<br>" +
"<b>Client ID</b>: " + serviceResponse.getClientId() +
"<br><span style=\"word-wrap: break-word\"><b>Client Secret</b>:" + serviceResponse.getClientSecret() + "</span>");
}
} catch (SQLException sqle) {
logger.error("Fail to save service.", sqle);
request.getSession().setAttribute("message", "There was an error registering your service. Please try again later.");
response.sendRedirect("./registeredServices");
return;
}
} else {
logger.error("Service request JSON is null");
request.getSession().setAttribute("message", "There was an error registering your service. Please try again later.");
response.sendRedirect("./registeredServices");
return;
}
} else {
int serviceIdInt = 0;
if (serviceId == null || serviceId.isEmpty()) { //TODO WRONG MESSAGE
request.getSession().setAttribute("message", "Service with id " + serviceId + " does not exist.");
response.sendRedirect("./registeredServices");
} else {
//System.out.println("In edit...");
try {
serviceIdInt = Integer.parseInt(serviceId);
if (!registeredServicesUtils.isAuthorized(authentication.getSub(), serviceIdInt)) {
request.getSession().setAttribute("message", "You have no permission to edit the service.");
response.sendRedirect("./registeredServices");
} else {
RegisteredService registeredService = registeredServicesUtils.getRegisteredServiceDao().fetchRegisteredServiceById(serviceIdInt);
if (registeredService != null && registeredService.getClientId() != null) {
String serverRequestJSON = null;
if (keyType == null) {
serverRequestJSON = createServiceJson(registeredService.getClientId(), name, email);
} else if (keyType.equals("uri")) {
serverRequestJSON = createServiceJson(registeredService.getClientId(), name, email, jwksUri);
} else if (keyType.equals("value")) {
serverRequestJSON = createServiceJson(registeredService.getClientId(), name, email, jwks);
}
if (serverRequestJSON != null) {
//System.out.println("SERVER JSON " + serverRequestJSON);
HttpResponse resp = tokenUtils.updateService(registeredService.getClientId(), serverRequestJSON, registeredService.getRegistrationAccessToken());
if (resp.getStatusLine().getStatusCode() == 200) {
//System.out.println("NAME >>>>" + name);
registeredService.setName(name);
//System.out.println("Client Id " + registeredService.getClientId());
try {
registeredServicesUtils.getRegisteredServiceDao().update(registeredService);
} catch (SQLException sqle) {
logger.error("Unable to contact db.", sqle);
request.getSession().setAttribute("message", "Fail to delete the service. Please try again later.");
response.setContentType("text/html");
request.getRequestDispatcher("./registeredServices.jsp").include(request, response);
return;
}
request.getSession().setAttribute("success",
"Your service has been successfully updated!<br>" +
"<b>Client ID</b>: " + registeredService.getClientId());
}
} else {
request.getSession().setAttribute("message", "Service with id " + serviceId + " does not exist.");
response.sendRedirect("./registeredServices");
return;
}
} else {
logger.error("Service request JSON is null");
request.getSession().setAttribute("message", "There was an error registering your service. Please try again later.");
response.sendRedirect("./registeredServices");
return;
}
}
} catch(SQLException sqle){
logger.error("Unable to access service with id " + serviceId, sqle);
request.getSession().setAttribute("message", "There was an error accessing your service.");
response.sendRedirect("./registeredServices");
} catch(NumberFormatException nfe){
logger.error("Unable to access service with id " + serviceId, nfe);
request.getSession().setAttribute("message", "Service with id " + serviceId + " does not exist.");
response.sendRedirect("./registeredServices");
}
}
}
} else {
//something is wrong with the form and the error messages will appear
request.getSession().setAttribute("first_name", name);
request.getSession().setAttribute("key_type", keyType);
request.getSession().setAttribute("uri", jwksUri);
request.getSession().setAttribute("value", jwksString);
if (serviceId != null && !serviceId.isEmpty()) {
request.getRequestDispatcher("./registerService.jsp?id=" + serviceId).forward(request, response);
} else {
request.getRequestDispatcher("./registerService.jsp").include(request, response);
}
return;
}
response.sendRedirect("./registeredServices");
}
private void checkmode(String mode) {
if (mode != null && !mode.isEmpty()) {
if (!mode.equals("edit") || mode.equals("create")) {
mode = "create";
}
} else {
mode = "create";
}
}
private boolean keyIsValid(String keyType, String jwksUri, String jwksString) {
return keyType == null || (keyType.equals("uri") && jwksUri != null && !jwksUri.isEmpty()) ||
keyType.equals("value") && jwksString != null && !jwksString.isEmpty();
}
private boolean userInfoIsValid(String userid, String email) {
return userid != null && !userid.isEmpty() &&
email != null && !email.isEmpty();
}
private boolean nameIsValid(String name) {
return name != null && !name.isEmpty();
}
private boolean checkNumberOfRegisteredServices(HttpServletRequest request, HttpServletResponse response, OIDCAuthenticationToken authentication) throws IOException {
try {
long numberOfRegisteredServices =
registeredServicesUtils.getRegisteredServiceDao().countRegisteredServices(authentication.getSub());
if (numberOfRegisteredServices >= 5) {
response.sendRedirect("./registeredServices"); // The message there already exists.
return false;
}
} catch (SQLException sqle) {
logger.error("Unable to count registered services.", sqle);
request.getSession().setAttribute("message", "Unable to contact DB. Please try again later.");
response.sendRedirect("./registeredServices");
return false;
}
return true;
}
private static String createServiceJson(String clientId, String name, String email) {
ServiceRequest serviceJSON = new ServiceRequest();
serviceJSON.setClientId(clientId);
serviceJSON.setClientName(name);
serviceJSON.setContacts(new String[]{email});
serviceJSON.setToken_endpoint_auth_method("client_secret_basic");
serviceJSON.setTokenEndpointAuthSigningAlg(null);
GsonBuilder builder = new GsonBuilder();
builder.serializeNulls();
Gson gson = builder.create();
//System.out.println("Created json " + serviceJSON);
return gson.toJson(serviceJSON);
}
private static String createServiceJson(String clientId, String name, String email, String jwksURI) {
ServiceRequest serviceJSON = new ServiceRequest();
serviceJSON.setClientId(clientId);
serviceJSON.setClientName(name);
serviceJSON.setContacts(new String[]{email});
serviceJSON.setJwksUri(jwksURI);
GsonBuilder builder = new GsonBuilder();
builder.serializeNulls();
Gson gson = builder.create();
//System.out.println("Created json " + serviceJSON);
return gson.toJson(serviceJSON);
}
private static String createServiceJson(String clientId, String name, String email, Jwks jwks) {
ServiceRequest serviceJSON = new ServiceRequest();
serviceJSON.setClientId(clientId);
serviceJSON.setClientName(name);
serviceJSON.setContacts(new String[]{email});
serviceJSON.setJwks(jwks);
GsonBuilder builder = new GsonBuilder();
builder.serializeNulls();
Gson gson = builder.create();
//System.out.println("Created json " + serviceJSON);
return gson.toJson(serviceJSON);
}
}

View File

@ -1,15 +1,6 @@
package eu.dnetlib.openaire.usermanagement;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import eu.dnetlib.openaire.user.pojos.RegisteredService;
import eu.dnetlib.openaire.usermanagement.utils.RegisteredServicesUtils;
import eu.dnetlib.openaire.usermanagement.utils.TokenUtils;
import org.apache.http.HttpResponse;
import org.apache.log4j.Logger;
import org.mitre.openid.connect.model.OIDCAuthenticationToken;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;
import javax.servlet.ServletConfig;
@ -18,20 +9,11 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class RegisteredServicesServlet extends HttpServlet {
private Logger logger = Logger.getLogger(RegisteredServicesServlet.class);
@Autowired
private RegisteredServicesUtils registeredServicesUtils;
@Autowired
private TokenUtils tokenUtils;
@Value("${developers.url}")
private String url;
public void init(ServletConfig config) throws ServletException {
super.init(config);
@ -39,122 +21,7 @@ public class RegisteredServicesServlet extends HttpServlet {
config.getServletContext());
}
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
request.getSession().setAttribute("authenticated",
!SecurityContextHolder.getContext().getAuthentication().getPrincipal().toString()
.equals("anonymousUser"));
OIDCAuthenticationToken authentication = (OIDCAuthenticationToken) SecurityContextHolder.
getContext().getAuthentication();
String userId = authentication.getSub();
List<RegisteredService> registeredServices = null;
try {
registeredServices = registeredServicesUtils.
getRegisteredServiceDao().fetchAllRegisteredServicesByOwner(userId);
//System.out.println("LOAD REGISTERED SERVICES. " + registeredServices.size());
if (registeredServices.isEmpty()) {
request.getSession().setAttribute("showEmptyList", true);
} else {
Map<String, ServiceResponse> serviceResponses = new HashMap<>();
Map<String, String> serviceKey = new HashMap<>();
for (RegisteredService registeredService:registeredServices) {
ServiceResponse serviceResponse = tokenUtils.getRegisteredService(registeredService.getClientId(),registeredService.getRegistrationAccessToken());
serviceResponses.put(registeredService.getId(), serviceResponse);
serviceKey.put(registeredService.getId(), extractPublicKeySet(serviceResponse));
}
boolean reachedLimit = reachedMaximumNumberOfServices(registeredServices);
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("reachedLimit", reachedLimit);
//System.out.println("REACHED LIMIT??? " + reachedLimit);
request.getSession().setAttribute("services", serviceResponses);
request.getSession().setAttribute("keys", serviceKey);
}
request.getSession().setAttribute("registeredServices", registeredServices);
} catch (SQLException sqle) {
logger.error("Error fetching registered services for user " + userId , sqle);
request.getSession().setAttribute("message", "Error fetching registered services. " +
"Please try again later.");
request.getSession().setAttribute("showEmptyList", false);
request.getRequestDispatcher("./registeredServices.jsp").include(request, response);
}
response.setContentType("text/html");
request.getRequestDispatcher("./registeredServices.jsp").include(request, response);
}
private String extractPublicKeySet(ServiceResponse serviceResponse) {
if (serviceResponse.getJwksUri()!=null && !serviceResponse.getJwksUri().isEmpty())
return serviceResponse.getJwksUri();
return extractJSONJwk(serviceResponse.getJwks());
}
private String extractJSONJwk(Jwks jwks) {
Gson gson = new GsonBuilder().setPrettyPrinting().create();
//System.out.println(gson.toJson(jwks));
return gson.toJson(jwks);
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
OIDCAuthenticationToken authentication = (OIDCAuthenticationToken) SecurityContextHolder.
getContext().getAuthentication();
String id = request.getParameter("id");
//System.out.println("POST " +id);
if (id!=null && !id.isEmpty()) {
try {
RegisteredService registeredService = registeredServicesUtils.getRegisteredServiceDao().fetchRegisteredServiceById(Integer.parseInt(id));
if (!registeredService.getOwner().equals(authentication.getSub())) {
request.getSession().setAttribute("message", "You are not allowed to delete the service.");
//System.out.println("BLOCKED " + registeredService.getOwner() + " >> " + authentication.getSub());
response.sendRedirect("./registeredServices");
return;
}
HttpResponse resp = tokenUtils.deleteService(registeredService.getClientId(), registeredService.getRegistrationAccessToken());
int statusCode = resp.getStatusLine().getStatusCode();
//System.out.println("STATUS CODE " + statusCode);
if (statusCode != 204) {
logger.error("Unable to delete the service. Status code was " + statusCode);
request.getSession().setAttribute("message", "Fail to delete the service. Status " + statusCode);
//System.out.println("AAI blocked");
response.sendRedirect("./registeredServices");
return;
} else {
registeredServicesUtils.getRegisteredServiceDao().delete(Integer.parseInt(id));
request.getSession().setAttribute("success", "The service was successfully deleted.");
//System.out.println("HERE HERE");
}
} catch (SQLException sqle) {
logger.error("Unable to contact db.", sqle);
request.getSession().setAttribute("message", "Fail to delete the service. Please try again later.");
}
} else {
request.getSession().setAttribute("message", "Error selecting service to delete. Please try again.");
}
response.sendRedirect("./registeredServices");
}
private boolean reachedMaximumNumberOfServices(List<RegisteredService> registeredServices) {
return registeredServices.size() >= 5;
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
response.sendRedirect(url + "/apis");
}
}

View File

@ -1,170 +0,0 @@
package eu.dnetlib.openaire.usermanagement;
import java.io.Serializable;
public class ServiceRequest {
String client_name;
String client_id;
String logo_uri;
String policy_uri;
String[] contacts;
String[] redirect_uris = new String[]{};
String[] grant_types = new String[] {"client_credentials"};
String token_endpoint_auth_method = "private_key_jwt";
String token_endpoint_auth_signing_alg = "RS256";
String jwks_uri;
Jwks jwks;
public String getClientName() {
return client_name;
}
public void setClientName(String clientName) {
this.client_name = clientName;
}
public String getClientId() {
return client_id;
}
public void setClientId(String clientId) {
this.client_id = clientId;
}
public String[] getRedirectUris() {
return redirect_uris;
}
public void setRedirectUris(String[] redirectUris) {
this.redirect_uris = redirectUris;
}
public String getLogoUri() {
return logo_uri;
}
public void setLogoUri(String logoUri) {
this.logo_uri = logoUri;
}
public String getPolicyUri() {
return policy_uri;
}
public void setPolicyUri(String policyUri) {
this.policy_uri = policyUri;
}
public String[] getContacts() {
return contacts;
}
public void setContacts(String[] contacts) {
this.contacts = contacts;
}
public String[] getGrantTypes() {
return grant_types;
}
public void setGrantTypes(String[] grantTypes) {
this.grant_types = grantTypes;
}
public String getToken_endpoint_auth_method() {
return token_endpoint_auth_method;
}
public void setToken_endpoint_auth_method(String token_endpoint_auth_method) {
this.token_endpoint_auth_method = token_endpoint_auth_method;
}
public String getTokenEndpointAuthSigningAlg() {
return token_endpoint_auth_signing_alg;
}
public void setTokenEndpointAuthSigningAlg(String tokenEndpointAuthSigningAlg) {
this.token_endpoint_auth_signing_alg = tokenEndpointAuthSigningAlg;
}
public String getJwksUri() {
return jwks_uri;
}
public void setJwksUri(String jwksUri) {
this.jwks_uri = jwksUri;
}
public Jwks getJwks() {
return jwks;
}
public void setJwks(Jwks jwks) {
this.jwks = jwks;
}
}
class Jwks implements Serializable {
Key[] keys;
public Key[] getKeys() {
return keys;
}
public void setKeys(Key[] keys) {
this.keys = keys;
}
}
class Key implements Serializable {
String kty;
String e;
String kid;
String alg;
String n;
public String getKty() {
return kty;
}
public void setKty(String kty) {
this.kty = kty;
}
public String getE() {
return e;
}
public void setE(String e) {
this.e = e;
}
public String getKid() {
return kid;
}
public void setKid(String kid) {
this.kid = kid;
}
public String getAlg() {
return alg;
}
public void setAlg(String alg) {
this.alg = alg;
}
public String getN() {
return n;
}
public void setN(String n) {
this.n = n;
}
}

View File

@ -1,93 +0,0 @@
package eu.dnetlib.openaire.usermanagement;
import java.io.Serializable;
public class ServiceResponse implements Serializable {
String client_id;
Long client_id_issued_at;
String client_secret;
Long client_secret_expires_at;
String registration_access_token;
String registration_client_uri;
String[] redirect_uris;
String client_name;
String logo_uri;
String policy_uri;
String[] contacts;
String[] grant_types;
String token_endpoint_auth_method;
String token_endpoint_auth_signing_alg;
String scope;
String jwks_uri;
Jwks jwks;
public String getClientId() {
return client_id;
}
public Long getClientIdIssuedAt() {
return client_id_issued_at;
}
public String getClientSecret() {
return client_secret;
}
public Long getClientSecretExpiresAt() {
return client_secret_expires_at;
}
public String getRegistrationAccessToken() {
return registration_access_token;
}
public String getRegistrationClientUri() {
return registration_client_uri;
}
public String[] getRedirectUris() {
return redirect_uris;
}
public String getClientName() {
return client_name;
}
public String getLogoUri() {
return logo_uri;
}
public String getPolicyUri() {
return policy_uri;
}
public String[] getContacts() {
return contacts;
}
public String[] getGrantTypes() {
return grant_types;
}
public String getTokenEndpointAuthMethod() {
return token_endpoint_auth_method;
}
public String getTokenEndpointAuthSigningAlg() {
return token_endpoint_auth_signing_alg;
}
public String getScope() {
return scope;
}
public String getJwksUri() {
return jwks_uri;
}
public Jwks getJwks() {
return jwks;
}
}

View File

@ -7,9 +7,9 @@ import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import eu.dnetlib.openaire.user.dao.SQLMigrationUserDAO;
import eu.dnetlib.openaire.user.ldap.MUserActionsLDAP;
import eu.dnetlib.openaire.user.login.utils.AuthoritiesMapper;
import eu.dnetlib.openaire.user.pojos.migration.LDAPUser;
import eu.dnetlib.openaire.user.store.DataSourceConnector;
import eu.dnetlib.openaire.usermanagement.authorization.AuthoritiesMapper;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;

View File

@ -0,0 +1,41 @@
package eu.dnetlib.openaire.usermanagement.authorization;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import org.apache.log4j.Logger;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import java.util.Collection;
import java.util.HashSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class AuthoritiesMapper {
private static final Logger logger = Logger.getLogger(AuthoritiesMapper.class);
public static Collection<? extends GrantedAuthority> map(JsonArray entitlements) {
HashSet<SimpleGrantedAuthority> authorities = new HashSet<>();
String regex = "urn:geant:openaire[.]eu:group:([^:]*):?(.*)?:role=member#aai[.]openaire[.]eu";
for(JsonElement obj: entitlements) {
Matcher matcher = Pattern.compile(regex).matcher(obj.getAsString());
if (matcher.find()) {
StringBuilder sb = new StringBuilder();
if(matcher.group(1) != null && matcher.group(1).length() > 0) {
sb.append(matcher.group(1).replace("+-+", "_").replaceAll("[+.]", "_").toUpperCase());
}
if(matcher.group(2).length() > 0) {
sb.append("_");
if(matcher.group(2).equals("admins")) {
sb.append("MANAGER");
} else {
sb.append(matcher.group(2).toUpperCase());
}
}
authorities.add(new SimpleGrantedAuthority(sb.toString()));
}
}
return authorities;
}
}

View File

@ -0,0 +1,49 @@
package eu.dnetlib.openaire.usermanagement.authorization;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.session.web.http.CookieSerializer;
import org.springframework.session.web.http.DefaultCookieSerializer;
@Configuration
@EnableRedisHttpSession
public class Config {
private static Logger logger = Logger.getLogger(Config.class);
@Value("${redis.host:localhost}")
private String host;
@Value("${redis.port:6379}")
private String port;
@Value("${redis.password:#{null}}")
private String password;
@Value("${webbapp.front.domain:.openaire.eu}")
private String domain;
@Bean
public LettuceConnectionFactory connectionFactory() {
logger.info(String.format("Redis connection listens to %s:%s ",host,port));
LettuceConnectionFactory factory = new LettuceConnectionFactory(host,Integer.parseInt(port));
if(password != null) factory.setPassword(password);
return factory;
}
@Bean
public CookieSerializer cookieSerializer() {
logger.info("Cookie Serializer: Domain is "+domain);
DefaultCookieSerializer serializer = new DefaultCookieSerializer();
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);
return serializer;
}
}

View File

@ -0,0 +1,19 @@
package eu.dnetlib.openaire.usermanagement.authorization;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.AuthenticationEntryPoint;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
public class EntryPoint implements AuthenticationEntryPoint {
@Override
public void commence(HttpServletRequest request, HttpServletResponse response,
AuthenticationException authException) throws IOException {
response.sendError(HttpServletResponse.SC_UNAUTHORIZED, authException.getMessage());
}
}

View File

@ -23,6 +23,9 @@ public class AuthorizationService {
} else if(type.equals("ri") && communityMap) {
type = "community";
}
while (type.contains(".")) {
type = type.replace(".", "_");
}
return type;
}

View File

@ -1,35 +0,0 @@
package eu.dnetlib.openaire.usermanagement.utils;
import eu.dnetlib.openaire.user.pojos.RegisteredService;
import eu.dnetlib.openaire.user.registeredService.RegisteredServiceDao;
import eu.dnetlib.openaire.user.registeredService.RegisteredServiceSQL;
import org.springframework.stereotype.Component;
import java.sql.SQLException;
@Component
public class RegisteredServicesUtils {
RegisteredServiceDao registeredServiceDao = new RegisteredServiceSQL();
public RegisteredServiceDao getRegisteredServiceDao() {
return registeredServiceDao;
}
public void setRegisteredServiceDao(RegisteredServiceDao registeredServiceDao) {
this.registeredServiceDao = registeredServiceDao;
}
public void addRegistedService(RegisteredService registeredService) throws SQLException {
registeredServiceDao.insertRegisteredService(registeredService);
}
public boolean isAuthorized(String userid, int id) throws SQLException {
RegisteredService registeredService = registeredServiceDao.fetchRegisteredServiceById(id);
if (registeredService == null) {
return false; //no harm in accessing nothing
}
return registeredService.getOwner().equals(userid);
}
}

View File

@ -1,91 +0,0 @@
package eu.dnetlib.openaire.usermanagement.utils;
import com.google.gson.Gson;
import eu.dnetlib.openaire.usermanagement.ServiceResponse;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpHeaders;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.List;
@Component
public class TokenUtils {
private Logger logger = Logger.getLogger(TokenUtils.class);
@Value("${oidc.issuer}")
private String issuer;
public String registerService(String serverRequestJSON)
throws IOException {
HttpPost httppost = new HttpPost( issuer + "register");
httppost.setHeader(HttpHeaders.CONTENT_TYPE, "application/json");
StringEntity params = new StringEntity(serverRequestJSON);
httppost.setEntity(params);
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpResponse httpResponse = httpclient.execute(httppost);
//System.out.println("HTTP RESPONSE " + httpResponse.getStatusLine().getStatusCode());
if (httpResponse.getStatusLine().getStatusCode() == 201) {
//logger.debug(IOUtils.toString(httpResponse.getEntity().getContent(), StandardCharsets.UTF_8.name()));
return IOUtils.toString(httpResponse.getEntity().getContent(), StandardCharsets.UTF_8.name());
}
return null;
}
public HttpResponse updateService(String serviceId, String serviceSON, String registeredAccessToken) throws IOException {
HttpPut httpPut = new HttpPut(issuer + "register/"+serviceId);
httpPut.setHeader(HttpHeaders.CONTENT_TYPE, "application/json");
httpPut.setHeader(HttpHeaders.AUTHORIZATION, "Bearer " + registeredAccessToken);
StringEntity params = new StringEntity(serviceSON.toString());
httpPut.setEntity(params);
CloseableHttpClient httpclient = HttpClients.createDefault();
return httpclient.execute(httpPut);
}
public HttpResponse deleteService(String serviceId, String registeredAccessToken) throws IOException {
//System.out.println("DELETE " + issuer + "register/"+serviceId);
HttpDelete httpDelete = new HttpDelete(issuer + "register/"+serviceId);
httpDelete.setHeader(HttpHeaders.CONTENT_TYPE, "application/json");
httpDelete.setHeader(HttpHeaders.AUTHORIZATION, "Bearer " + registeredAccessToken);
CloseableHttpClient httpclient = HttpClients.createDefault();
return httpclient.execute(httpDelete);
}
public ServiceResponse getRegisteredService(String serviceId, String registeredAccessToken) throws IOException {
//System.out.println("ISSUER " + issuer);
HttpGet httpGet = new HttpGet(issuer + "register/"+ serviceId);
httpGet.setHeader(HttpHeaders.AUTHORIZATION, "Bearer " + registeredAccessToken);
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpResponse httpResponse = httpclient.execute(httpGet);
String registeredService = IOUtils.toString(httpResponse.getEntity().getContent(), StandardCharsets.UTF_8.name());
//System.out.println(registeredService);
return new Gson().fromJson(registeredService,ServiceResponse.class);
}
public void viewRegisteredServices(List<String> serviceIds, String registeredAccessToken) throws IOException {
for (String serviceId: serviceIds) {
getRegisteredService(serviceId, registeredAccessToken);
}
}
}

View File

@ -2,3 +2,13 @@ google.recaptcha.secret = 6LfYrU8UAAAAADwrbImPvDo_XcxEZvrkkgMy9yU0
google.recaptcha.key = 6LfYrU8UAAAAAFsl3m2YhP1uavdmAdFEXBkoY_vd
role-management.url = http://mpagasas.di.uoa.gr:8080/dnet-role-management
developers.url = http://mpagasas.di.uoa.gr:5100
# Redis
redis.host = 127.0.0.1
#redis.port = 6379
#redis.password
webbapp.front = http://mpagasas.di.uoa.gr:4200/reload
webbapp.front.path = /
webbapp.front.domain = .di.uoa.gr

View File

@ -9,9 +9,7 @@
http://www.springframework.org/schema/context/spring-context-4.2.xsd">
<import resource="classpath*:/eu/dnetlib/openaire/user/springContext-userManagementService.xml" />
<import resource="classpath*:/eu/dnetlib/openaire/user/login/springContext-userLoginCore.xml" />
<import resource="classpath*:/eu/dnetlib/openaire/user/springContext-userManagementService.xml"/>
<context:component-scan base-package="eu.dnetlib.openaire.usermanagement.*"/>
<context:annotation-config />
@ -33,12 +31,10 @@
<value>classpath*:/eu/**/applicationContext*.properties</value>
<value>classpath*:/eu/dnetlib/applicationContext-defaultProperties.properties</value>
<value>classpath*:/eu/**/springContext-userManagementService.properties</value>
<value>classpath*:/eu/**/springContext-userLoginCore.properties</value>
<value>classpath*:/eu/**/springContext-dnetOpenaireUsersService.properties</value>
<value>classpath*:/uoa-override.properties</value>
<value>classpath*:/dnet-override.properties</value>
</list>
</property>
</bean>
</beans>
</beans>

View File

@ -2,12 +2,27 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
xmlns:security="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-4.2.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd"
default-autowire="byType">
<context:component-scan base-package="eu.dnetlib.openaire.user.api.services" />
<context:component-scan base-package="eu.dnetlib.openaire.user"/>
<context:annotation-config></context:annotation-config>
</beans>
<bean id="entryPoint" class="eu.dnetlib.openaire.usermanagement.authorization.EntryPoint"/>
<bean id="openIdConnectAuthenticationProvider" class="org.mitre.openid.connect.client.OIDCAuthenticationProvider">
</bean>
<security:authentication-manager alias="authenticationManager">
<security:authentication-provider ref="openIdConnectAuthenticationProvider" />
</security:authentication-manager>
<security:global-method-security pre-post-annotations="enabled" secured-annotations="enabled" authentication-manager-ref="authenticationManager" />
<security:http auto-config="true" use-expressions="true">
<security:csrf disabled="true"/>
<security:http-basic entry-point-ref="entryPoint"/>
<!-- Permit all requests -->
<security:intercept-url pattern="/**" access="permitAll" />
</security:http>
<context:annotation-config/>
</beans>

View File

@ -1,139 +1,80 @@
<%--
Created by IntelliJ IDEA.
User: sofia
Date: 20/10/2017
Time: 3:43 μμ
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href=".">
<title>OpenAIRE - Activation</title>
<script src="./js/jquery.js"></script>
<script src="./js/uikit.min.js"></script>
<script src="./js/validation.js"></script>
<link rel="stylesheet" style="text/css" href="./css/theme.css">
<link rel="stylesheet" style="text/css" href="./css/custom.css">
<link rel="stylesheet" style="text/css" href="./css/aai-custom.css">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="images/favicon//favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
</head>
<body class="" style="">
<div class="uk-offcanvas-content uk-height-viewport">
<!-- MENU STARTS HERE -->
<!-- MAIN MENU STARTS HERE -->
<div class="tm-header tm-header-transparent" uk-header="">
<div class="uk-container uk-container-expand">
<nav class="uk-navbar" uk-navbar="{&quot;align&quot;:&quot;left&quot;}">
<div class="uk-navbar-center">
<div class="uk-logo uk-navbar-item">
<img alt="OpenAIRE" class="uk-responsive-height" src="./images/Logo_Horizontal.png">
</div>
</div>
</nav>
</div>
<jsp:include page="head.jsp">
<jsp:param name="title" value="OpenAIRE - Activate Account"/>
<jsp:param name="form" value="true"/>
</jsp:include>
<body>
<div class="uk-section uk-section-small uk-container uk-container-small">
<div class="uk-text-center">
<img src="images/Logo_Horizontal.png" style="height: 80px;">
<h1 class="uk-h4 uk-margin-large-top">Thank you for registering!</h1>
<div class="uk-text-large uk-margin-medium-bottom">
The next step is to <span class="uk-text-bolder">activate your account.</span>
</div>
<div class="uk-margin-large-bottom">
An <span class="uk-text-bolder">email</span> with your username and an <span
class="uk-text-bolder">activation code</span>
has been sent to you. Please use them in the form below to activate your account.
The activation code <span class="uk-text-bold uk-text-warning">expires in 24 hours</span>.
</div>
</div>
<!-- MENU ENDS HERE -->
<!-- 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" uk-grid="">
</div>
</div>
<div class="tm-middle custom-main-content" id="tm-main">
<div class="uk-container uk-container-small uk-section uk-margin-small-bottom uk-text-center">
<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 ">
<!-- CENTER SIDE -->
<div class="uk-width-1-1@m uk-width-1-1@s uk-text-center">
<div class="middle-box text-center loginscreen animated fadeInDown ">
<p>Thank you for registering! <br>
The next step is to <span class="uk-text-bold uk-text-primary">activate your account.</span><br><br>
An <span class="uk-text-bold">email</span> with your username and an <span class="uk-text-bold">activation code</span> has been sent to you. Please use them in the form below to activate your account.<br>
<span class="uk-text-bold">Note:</span> the activation code <span class="uk-text-warning">expires in 24 hours</span>.
</p>
<div class="uk-width-1-3@m uk-align-center">
<!-- Validate form -->
<div id="registerForm" class="uk-padding">
<form action="activate" method="POST" role="form" class="m-t" id="register_form">
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div class="alert alert-success" aria-hidden="true" style="display: none;"></div>
<div class="alert alert-danger" aria-hidden="true" style="display: none;"></div>
<div class="form-group">
<span id="server_error" class="uk-text-danger uk-text-small uk-float-left">${message}</span>
<c:remove var="message" scope="session" />
<span id="server_username_error" class="uk-text-danger uk-text-small uk-float-left">${msg_username_error}</span>
<c:remove var="msg_username_error" scope="session" />
<input id="username" name="username" type="text" placeholder="Username" class="form-control"></div>
<div class="form-group">
<span id="server_activation_code_error" class="uk-text-danger uk-text-small uk-float-left">${msg_activation_code_error}</span>
<c:remove var="msg_activation_code_error" scope="session" />
<input id="verification_code" name="verification_code" type="text" placeholder="Activation Code" value="${param.code}" class="form-control"></div>
<div class="uk-margin uk-grid-small uk-child-width-auto uk-grid uk-text-left uk-grid-stack" uk-grid="">
<div class="uk-width-1-1 uk-grid-margin uk-first-column">
<button type="submit" class="uk-button uk-button-primary" onclick="return validateForm();">Activate account</button>
</div>
</div>
</form>
</div>
<!-- END OF REGISTER FORM -->
<script>
$("#username").focusin(function() {
$(this).removeClass('aai-form-danger');
$("#server_username_error").fadeOut();
$("#server_error").fadeOut();
});
$("#verification_code").focusin(function() {
$(this).removeClass('aai-form-danger');
$("#server_activation_code_error").fadeOut();
$("#server_error").fadeOut();
});
</script>
</div>
</ul>
</div>
</div>
<!-- END OF CENTER SIDE -->
</div>
</div>
<form action="activate" method="POST" role="form"
class="uk-grid uk-child-width-1-1 uk-flex-column uk-flex-middle" uk-grid>
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div input id="username" class="uk-width-medium@s">
<div class="input-wrapper inner x-small">
<div class="input-box">
<div class="placeholder">
<label>Username <sup>*</sup></label>
</div>
</div>
</div>
<!-- CONTENT ENDS HERE -->
<!-- FOOTER STARTS HERE-->
<div class="custom-footer" style="z-index: 200;">
<div class="uk-section-primary uk-section uk-section-small">
<div class="uk-container">
<div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid="">
<div class="uk-width-1-1@m uk-first-column">
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-center">
<img alt="OpenAIRE" class="el-image" src="./images/Logo_Horizontal_white_small.png">
</div>
<div class="footer-license uk-margin uk-margin-remove-bottom uk-text-center uk-text-lead">
<div><a href="http://creativecommons.org/licenses/by/4.0/" target="_blank" rel="license"><img alt="Creative" src="./images/80x15.png" style="height: auto; max-width: 100%; vertical-align: middle;"></a>&nbsp;UNLESS OTHERWISE INDICATED, ALL MATERIALS CREATED BY THE OPENAIRE CONSORTIUM ARE LICENSED UNDER A&nbsp;<a href="http://creativecommons.org/licenses/by/4.0/" rel="license">CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE</a>.</div>
<div>OPENAIRE IS POWERED BY&nbsp;<a href="http://www.d-net.research-infrastructures.eu/">D-NET</a>.</div>
</div>
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-right">
<a class="uk-totop uk-icon" href="#" uk-scroll="" uk-totop="">
</a>
</div>
</div>
</div>
<div class="uk-flex uk-flex-middle">
<input name="username" class="input uk-text-truncate">
</div>
</div>
</div>
</div>
<!-- FOOTER ENDS HERE -->
</div>
<span id="server_username_error" class="uk-text-danger uk-text-small">
${msg_username_error}
</span>
<c:remove var="msg_username_error" scope="session" />
</div>
<div input id="verification_code" class="uk-width-medium@s">
<div class="input-wrapper inner x-small">
<div class="input-box">
<div class="placeholder">
<label>Activation Code <sup>*</sup></label>
</div>
<div class="uk-flex uk-flex-middle">
<input name="verification_code" value="${param.code}" class="input uk-text-truncate">
</div>
</div>
</div>
<span id="server_activation_code_error" class="uk-text-danger uk-text-small">
${msg_activation_code_error}
</span>
<c:remove var="msg_activation_code_error" scope="session" />
</div>
<div class="uk-width-1-1 uk-text-center">
<div id="server_error" class="uk-text-danger uk-text-center uk-text-small uk-margin-bottom">${message}</div>
<c:remove var="message" scope="session" />
<button type="submit" class="uk-button uk-button-primary" onclick="return validateForm();">
Activate
</button>
</div>
</form>
</div>
</body>
<script>
$("#username input").focusin(function() {
$("#server_username_error").hide();
$("#server_error").hide();
});
$("#verification_code input").focusin(function() {
$("#server_activation_code_error").hide();
$("#server_error").hide();
});
</script>
</html>

View File

@ -1,211 +1,99 @@
<%--
Created by IntelliJ IDEA.
User: sofia
Date: 23/10/2017
Time: 3:58 μμ
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<% if (session.getAttribute("username") == null) {
String redirectURL = request.getContextPath() + "/forgotPassword.jsp";
response.sendRedirect(redirectURL);
}%>
<%--<%String name=(String)request.getAttribute("name");--%>
<%--out.print("your name"+name);%>--%>
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href=".">
<title>OpenAIRE - Enter new password</title>
<script src="./js/jquery.js"></script>
<script src="./js/uikit.min.js"></script>
<script src="./js/validation.js"></script>
<script src="./js/uikit-icons.min.js"></script>
<link rel="stylesheet" style="text/css" href="./css/theme.css">
<link rel="stylesheet" style="text/css" href="./css/custom.css">
<link rel="stylesheet" style="text/css" href="./css/aai-custom.css">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="images/favicon//favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
</head>
<body class="" style="">
<div class="uk-offcanvas-content uk-height-viewport">
<!-- MENU STARTS HERE -->
<!-- MAIN MENU STARTS HERE -->
<div class="tm-header tm-header-transparent" uk-header="">
<div class="uk-container uk-container-expand">
<nav class="uk-navbar" uk-navbar="{&quot;align&quot;:&quot;left&quot;}">
<div class="uk-navbar-center">
<div class="uk-logo uk-navbar-item">
<img alt="OpenAIRE" class="uk-responsive-height" src="./images/Logo_Horizontal.png">
<jsp:include page="head.jsp">
<jsp:param name="title" value="OpenAIRE - Enter a new password"/>
<jsp:param name="form" value="true"/>
</jsp:include>
<body>
<div class="uk-section uk-section-small uk-container uk-container-small">
<div class="uk-text-center">
<img src="images/Logo_Horizontal.png" style="height: 80px;">
<h1 class="uk-h4 uk-margin-large-top">Enter a new password</h1>
<div class="uk-margin-large-bottom uk-margin-medium-top">
To complete the password reset process, please enter a new password.
</div>
</div>
<form action="resetPassword" method="POST" role="form"
class="uk-grid uk-child-width-1-1 uk-flex-column uk-flex-middle" uk-grid>
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div input id="password" class="uk-width-medium@s">
<div class="input-wrapper inner x-small">
<div class="input-box">
<div class="placeholder">
<label>Password <sup>*</sup></label>
</div>
<div class="uk-flex uk-flex-middle">
<input name="password" type="password" class="input uk-text-truncate">
</div>
</div>
</nav>
</div>
<div id="msg_pass_error" class="uk-text-danger uk-text-small" style="display: none;">Please enter your password.</div>
<div id="msg_pass_conf_error" class="uk-text-danger uk-text-small" style="display: none;">The passwords don't match.</div>
<div id="msg_whitespace" class="uk-text-danger uk-text-small" style="display: none;">No white space allowed.</div>
<div id="msg_lowercase_letter" class="uk-text-danger uk-text-small" style="display: none;">Please add a lowercase letter.</div>
<div id="msg_uppercase_letter" class="uk-text-danger uk-text-small" style="display: none;">Please add an uppercase letter.</div>
<div id="msg_number" class="uk-text-danger uk-text-small" style="display: none;">Please add a number.</div>
<div id="msg_length" class="uk-text-danger uk-text-small" style="display: none;">Must contains at least 6 characters.</div>
<div id="msg_invalid_password" class="uk-text-danger uk-text-small" style="display: none;">
The password must contain a lowercase letter, a capital (uppercase) letter, a number and must be at least 6 characters long. White space character is not allowed.
</div>
<c:remove var="msg_pass_conf_error_display" scope="session" />
<c:remove var="msg_password_error_display" scope="session" />
<c:remove var="msg_invalid_password_display" scope="session" />
</div>
</div>
<!-- MENU ENDS HERE -->
<!-- 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" uk-grid="">
</div>
</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-small-bottom uk-text-center">
<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 ">
<!-- CENTER SIDE -->
<div class="uk-width-1-1@m uk-width-1-1@s uk-text-center">
<div class="middle-box text-center loginscreen animated fadeInDown ">
<%--<span uk-icon="icon: check"></span>--%>
<%--<a href="" uk-icon="icon: heart"></a>--%>
<%--<h3 uk-icon="icon: check"></h3>--%>
<h3 class="uk-h4 uk-text-success"><span uk-icon="icon: check; ratio: 1.3"></span> Your email is now verified!</h3>
<p>To complete the password reset process, please enter a new password. <b>Must contain at least one number and one uppercase and lowercase letter, and at least 6 or more characters. No white space allowed.</b></p>
<div class="uk-width-1-3@m uk-align-center">
<!-- REGISTER FORM -->
<div id="registerForm">
<form action="resetPassword" method="POST" role="form" class="m-t" id="register_form" >
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div class="alert alert-success" aria-hidden="true" style="display: none;"></div>
<div class="alert alert-danger" aria-hidden="true" style="display: none;"></div>
<div class="form-group">
<span class="msg_password_error uk-text-danger uk-text-small uk-float-left" style="display:none">Please enter your password.</span>
<span class="msg_pass_conf_error uk-text-danger uk-text-small uk-float-left" style="display:none">These passwords don't match.</span>
<p><span class="msg_please_add uk-text-danger uk-text-small uk-float-left" style="display:none">Please add: &nbsp</span></p>
<span class="msg_lowercase_letter uk-text-danger uk-text-small uk-float-left" style="display:none">A lowercase letter. &nbsp</span>
<span class="msg_capital_letter uk-text-danger uk-text-small uk-float-left" style="display:none">A capital (uppercase) letter. &nbsp </span>
<span class="msg_number uk-text-danger uk-text-small uk-float-left" style="display:none">A number. &nbsp</span>
<span class="msg_lenght uk-text-danger uk-text-small uk-float-left" style="display:none">Minimum 6 characters. &nbsp</span>
<p><span class="msg_space uk-text-danger uk-text-small uk-float-left" style="display:none">No white space allowed &nbsp</span></p>
<%--<span id="server_invalid_password_error" class="uk-text-danger uk-text-small uk-float-left">${msg_invalid_password}</span>--%>
<%--<c:remove var="msg_invalid_password" scope="session" />--%>
<input id="password" name="password" type="password" placeholder="Password" class="form-control"></div>
<div class="form-group">
<input id="password_conf" name="password_conf" type="password" placeholder="Confirm password" class="form-control"></div>
<div class="uk-margin uk-grid-small uk-child-width-auto uk-grid uk-text-left uk-grid-stack" uk-grid="">
<div class="uk-width-1-1 uk-grid-margin uk-first-column">
<button type="submit" class="uk-button uk-button-primary" onclick="return validatePasswordForm();">Submit</button>
</div>
</div>
</form>
</div>
<!-- END OF REGISTER FORM -->
<script>
var password = document.getElementById("password");
// When the user starts to type something inside the password field
password.onkeyup = function() {
// Validate lowercase letters
var lowerCaseLetters = /[a-z]/g;
if (password.value.match(lowerCaseLetters)) {
$(".msg_lowercase_letter").fadeOut();
} else {
$(".msg_lowercase_letter").fadeIn();
}
// Validate capital letters
var upperCaseLetters = /[A-Z]/g;
if (password.value.match(upperCaseLetters)) {
$(".msg_capital_letter").fadeOut();
} else {
$(".msg_capital_letter").fadeIn();
}
// Validate numbers
var numbers = /[0-9]/g;
if (password.value.match(numbers)) {
$(".msg_number").fadeOut();
} else {
$(".msg_number").fadeIn();
}
// Validate length
if (password.value.length >= 6) {
$(".msg_lenght").fadeOut();
} else {
$(".msg_lenght").fadeIn();
}
// Validate no white space
var space = /[\s]+/g;
if (password.value.match(space)){
$(".msg_space").fadeIn();
} else {
$(".msg_space").fadeOut();
}
if(password.value.match(lowerCaseLetters) && password.value.match(upperCaseLetters)
&& password.value.match(numbers) && (password.value.length >= 6)){
if($(".msg_please_add").css('display')!='none'){
$(".msg_please_add").fadeOut();
}
} else {
if($(".msg_please_add").css('display')=='none') {
$(".msg_please_add").fadeIn();
}
}
$("#password").focusin(function () {
$(this).removeClass('aai-form-danger');
$(".msg_please_add").fadeOut();
$(".msg_password_error").fadeOut();
$(".msg_pass_conf_error").fadeOut();
// $("#server_invalid_password_error").fadeOut();
$(".msg_lowercase_letter").fadeOut();
$(".msg_capital_letter").fadeOut();
$(".msg_number").fadeOut();
$(".msg_lenght").fadeOut();
});
$("#password_conf").focusin(function () {
$(this).removeClass('aai-form-danger');
$(".msg_pass_conf_error").fadeOut();
});
}
</script>
</div>
</ul>
</div>
</div>
<!-- END OF CENTER SIDE -->
<div input id="password_conf" class="uk-width-medium@s">
<div class="input-wrapper inner x-small">
<div class="input-box">
<div class="placeholder">
<label>Confirm Password <sup>*</sup></label>
</div>
<div class="uk-flex uk-flex-middle">
<input name="password_conf" type="password" class="input uk-text-truncate">
</div>
</div>
</div>
</div>
</div>
<!-- CONTENT ENDS HERE -->
<!-- FOOTER STARTS HERE-->
<div class="custom-footer" style="z-index: 200;">
<div class="uk-section-primary uk-section uk-section-small">
<div class="uk-container">
<div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid="">
<div class="uk-width-1-1@m uk-first-column">
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-center">
<img alt="OpenAIRE" class="el-image" src="./images/Logo_Horizontal_white_small.png">
</div>
<div class="footer-license uk-margin uk-margin-remove-bottom uk-text-center uk-text-lead">
<div><a href="http://creativecommons.org/licenses/by/4.0/" target="_blank" rel="license"><img alt="Creative" src="./images/80x15.png" style="height: auto; max-width: 100%; vertical-align: middle;"></a>&nbsp;UNLESS OTHERWISE INDICATED, ALL MATERIALS CREATED BY THE OPENAIRE CONSORTIUM ARE LICENSED UNDER A&nbsp;<a href="http://creativecommons.org/licenses/by/4.0/" rel="license">CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE</a>.</div>
<div>OPENAIRE IS POWERED BY&nbsp;<a href="http://www.d-net.research-infrastructures.eu/">D-NET</a>.</div>
</div>
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-right">
<a class="uk-totop uk-icon" href="#" uk-scroll="" uk-totop="">
</a>
</div>
</div>
</div>
</div>
<div class="uk-width-1-1 uk-flex uk-flex-center">
<div class="g-recaptcha" data-sitekey=${applicationScope.sitekey}></div>
</div>
</div> <!-- FOOTER ENDS HERE -->
<div class="uk-width-1-1 uk-text-center">
<div id="server_error" class="uk-text-danger uk-text-center uk-text-small uk-margin-bottom">${message}</div>
<c:remove var="message" scope="session" />
<button type="submit" class="uk-button uk-button-primary" onclick="return validatePasswordForm();">
Submit
</button>
</div>
</form>
</div>
</body>
</html>
<script>
$("input").focusin(function () {
$("#server_error").hide();
});
// On the fly check for password validation
let password = $("#password input")[0];
password.onkeyup = function () {
validatePassword(password.value);
};
$("#password input").focusin(function () {
$("#msg_password_error").hide();
$("#msg_pass_conf_error").hide();
$("#msg_lowercase_letter").hide();
$("#msg_capital_letter").hide();
$("#msg_number").hide();
$("#msg_length").hide();
});
$("#password_conf input").focusin(function () {
$("#msg_pass_conf_error").hide();
});
</script>
</html>

View File

@ -4,11 +4,11 @@
<jsp:param name="title" value="OpenAIRE - Email Confirmation"/>
</jsp:include>
<body>
<div class="uk-section uk-container uk-container-small uk-text-center">
<div class="uk-section uk-section-small uk-container uk-container-small uk-text-center">
<img src="images/Logo_Horizontal.png" style="height: 80px;">
<h1 class="uk-h4 uk-margin-large-top">PLEASE VERIFY YOUR EMAIL</h1>
<div class="uk-text-large">You will need to verify your email to complete registration.</div>
<img class="uk-margin-large-top uk-margin-large-bottom" src="images/envelope.svg" style="height: 180px;">
<img class="uk-margin-large-top uk-margin-large-bottom" src="images/envelope.svg" style="height: 140px;">
<div class="uk-margin-medium-bottom">
An email has been sent to your email with a link to verify your account.<br>
If you have not received the email after a few minutes, please check your spam folder.

View File

@ -1,10 +1,3 @@
<%--
Created by IntelliJ IDEA.
User: sofia
Date: 30/10/2017
Time: 1:07 μμ
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
@ -14,92 +7,20 @@
} else if (session.getAttribute("emailSuccess") != null) {
session.removeAttribute("emailSuccess");
}%>
<%--<META HTTP-EQUIV=Refresh CONTENT="0.5; URL=http://beta.services.openaire.eu/uoa-user-management/openid_connect_login">--%>
<META HTTP-EQUIV=Refresh CONTENT='0.5; URL=<%= session.getAttribute("homeUrl")%>'>
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OpenAIRE - Email Sent</title>
<script src="./js/jquery.js"></script>
<script src="./js/uikit.min.js"></script>
<script src="./js/validation.js"></script>
<link rel="stylesheet" style="text/css" href="./css/theme.css">
<link rel="stylesheet" style="text/css" href="./css/custom.css">
<link rel="stylesheet" style="text/css" href="./css/aai-custom.css">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="images/favicon//favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
</head>
<body class="" style="">
<div class="uk-offcanvas-content uk-height-viewport">
<!-- MENU STARTS HERE -->
<!-- MAIN MENU STARTS HERE -->
<div class="tm-header tm-header-transparent" uk-header="">
<div class="uk-container uk-container-expand">
<nav class="uk-navbar" uk-navbar="{&quot;align&quot;:&quot;left&quot;}">
<div class="uk-navbar-center">
<div class="uk-logo uk-navbar-item">
<img alt="OpenAIRE" class="uk-responsive-height" src="./images/Logo_Horizontal.png">
</div>
</div>
</nav>
<jsp:include page="head.jsp">
<jsp:param name="title" value="OpenAIRE - Email Sent"/>
</jsp:include>
<body>
<div class="uk-section uk-section-small uk-container uk-container-small">
<div class="uk-text-center">
<img src="images/Logo_Horizontal.png" style="height: 80px;">
<div class="uk-margin-large-top uk-text-success">
<span class="material-icons" style="font-size: 180px;">check</span>
</div>
<div class="uk-text-large uk-text-bold uk-margin-medium-top">Your username has been successfully sent to your email!</div>
</div>
<!-- MENU ENDS HERE -->
<!-- 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" uk-grid="">
</div>
</div>
<div class=" uk-section tm-middle custom-main-content" id="tm-main">
<div class="uk-container uk-container-small uk-margin-small-bottom uk-text-center">
<%--<h2 class="uk-h2 uk-margin-small-bottom">Forgot Password</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 ">
<!-- CENTER SIDE -->
<div class="uk-width-1-1@m uk-width-1-1@s uk-text-center">
<!-- <h3 class="uk-h3">Create an account</h3> -->
<div class="middle-box text-center loginscreen animated fadeInDown ">
<h3 class="uk-h4 uk-text-success">Your username has been successfully sent!</h3>
<div class="uk-width-1-3@m uk-align-center">
<%--<p>Please click <a href="http://beta.services.openaire.eu/uoa-user-management/openid_connect_login">here</a> to login.</p>--%>
</div>
</ul>
</div>
</div>
<!-- END OF CENTER SIDE -->
</div>
</div>
</div>
</div>
</div>
<!-- CONTENT ENDS HERE -->
<!-- FOOTER STARTS HERE-->
<div class="custom-footer" style="z-index: 200;">
<div class="uk-section-primary uk-section uk-section-small">
<div class="uk-container">
<div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid="">
<div class="uk-width-1-1@m uk-first-column">
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-center">
<img alt="OpenAIRE" class="el-image" src="./images/Logo_Horizontal_white_small.png">
</div>
<div class="footer-license uk-margin uk-margin-remove-bottom uk-text-center uk-text-lead">
<div><a href="http://creativecommons.org/licenses/by/4.0/" target="_blank" rel="license"><img alt="Creative" src="./images/80x15.png" style="height: auto; max-width: 100%; vertical-align: middle;"></a>&nbsp;UNLESS OTHERWISE INDICATED, ALL MATERIALS CREATED BY THE OPENAIRE CONSORTIUM ARE LICENSED UNDER A&nbsp;<a href="http://creativecommons.org/licenses/by/4.0/" rel="license">CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE</a>.</div>
<div>OPENAIRE IS POWERED BY&nbsp;<a href="http://www.d-net.research-infrastructures.eu/">D-NET</a>.</div>
</div>
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-right">
<a class="uk-totop uk-icon" href="#" uk-scroll="" uk-totop="">
</a>
</div>
</div>
</div>
</div>
</div>
</div> <!-- FOOTER ENDS HERE -->
</div>
</body>
</html>

View File

@ -1,94 +1,25 @@
<%--
Created by IntelliJ IDEA.
User: sofia
Date: 12/10/2017
Time: 4:16 μμ
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<% if (session.getAttribute("error") == null) {
String redirectURL = request.getContextPath() + "/error404.jsp";
response.sendRedirect(redirectURL);
} else if (session.getAttribute("error") != null) {
session.removeAttribute("error");
String redirectURL = request.getContextPath() + "/error404.jsp";
response.sendRedirect(redirectURL);
} else if (session.getAttribute("error") != null) {
session.removeAttribute("error");
}%>
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href=".">
<title>OpenAIRE - Error</title>
<script src="./js/jquery.js"></script>
<script src="./js/uikit.min.js"></script>
<script src="./js/validation.js"></script>
<link rel="stylesheet" style="text/css" href="./css/theme.css">
<link rel="stylesheet" style="text/css" href="./css/custom.css">
<link rel="stylesheet" style="text/css" href="./css/aai-custom.css">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="images/favicon//favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
</head>
<body class="" style="">
<div class="uk-offcanvas-content uk-height-viewport">
<div class="tm-header tm-header-transparent">
<div class="uk-container uk-container-expand">
<nav class="uk-navbar" uk-navbar="{&quot;align&quot;:&quot;left&quot;}">
<div class="uk-navbar-center">
<div class="uk-logo uk-navbar-item">
<img alt="OpenAIRE" class="uk-responsive-height" src="./images/Logo_Horizontal.png">
</div>
</div>
</nav>
<jsp:include page="head.jsp">
<jsp:param name="title" value="OpenAIRE - Error"/>
</jsp:include>
<body>
<div class="uk-section uk-section-small uk-container uk-container-small">
<div class="uk-text-center">
<img src="images/Logo_Horizontal.png" style="height: 80px;">
<h1 class="uk-h4 uk-text-danger uk-margin-large-top">Oops! Something went wrong!</h1>
<div class="uk-margin-large-bottom uk-margin-medium-top">
Something went wrong. Please try again later or contact OpenAIRE <a href="https://www.openaire.eu/support/helpdesk">helpdesk</a>. We apologize for the inconvenience.
</div>
</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>
</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">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-h4 uk-text-danger">Oops! Something went wrong!</h3>
<div class="middle-box loginscreen animated fadeInDown uk-text-left ">
<p>Something went wrong. Please try again later or contact OpenAIRE <a href="https://www.openaire.eu/support/helpdesk">helpdesk</a>. We apologize for the inconvenience.</p>
</div>
</div>
</div>
</div>
</div>
<!-- CONTENT ENDS HERE -->
<!-- FOOTER STARTS HERE-->
<div class="custom-footer" style="z-index: 200;">
<div class="uk-section-primary uk-section uk-section-small">
<div class="uk-container">
<div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid="">
<div class="uk-width-1-1@m uk-first-column">
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-center">
<img alt="OpenAIRE" class="el-image" src="./images/Logo_Horizontal_white_small.png">
</div>
<div class="footer-license uk-margin uk-margin-remove-bottom uk-text-center uk-text-lead">
<div><a href="http://creativecommons.org/licenses/by/4.0/" target="_blank" rel="license"><img alt="Creative" src="./images/80x15.png" style="height: auto; max-width: 100%; vertical-align: middle;"></a>&nbsp;UNLESS OTHERWISE INDICATED, ALL MATERIALS CREATED BY THE OPENAIRE CONSORTIUM ARE LICENSED UNDER A&nbsp;<a href="http://creativecommons.org/licenses/by/4.0/" rel="license">CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE</a>.</div>
<div>OPENAIRE IS POWERED BY&nbsp;<a href="http://www.d-net.research-infrastructures.eu/">D-NET</a>.</div>
</div>
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-right">
<a class="uk-totop uk-icon" href="#" uk-scroll="" uk-totop="">
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- FOOTER ENDS HERE -->
</div>
</body>
</html>

View File

@ -1,80 +1,19 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href=".">
<title>OpenAIRE - Error 404</title>
<script src="./js/jquery.js"></script>
<script src="./js/uikit.min.js"></script>
<script src="./js/validation.js"></script>
<link rel="stylesheet" style="text/css" href="./css/theme.css">
<link rel="stylesheet" style="text/css" href="./css/custom.css">
<link rel="stylesheet" style="text/css" href="./css/aai-custom.css">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="images/favicon//favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
</head>
<body class="" style="">
<div class="uk-offcanvas-content uk-height-viewport">
<div class="tm-header tm-header-transparent">
<div class="uk-container uk-container-expand">
<nav class="uk-navbar" uk-navbar="{&quot;align&quot;:&quot;left&quot;}">
<div class="uk-navbar-center">
<div class="uk-logo uk-navbar-item">
<img alt="OpenAIRE" class="uk-responsive-height" src="./images/Logo_Horizontal.png">
</div>
</div>
</nav>
<jsp:include page="head.jsp">
<jsp:param name="title" value="OpenAIRE - Error 404"/>
</jsp:include>
<body>
<div class="uk-section uk-section-small uk-container uk-container-small">
<div class="uk-text-center">
<img src="images/Logo_Horizontal.png" style="height: 80px;">
<h1 class="uk-h4 uk-text-danger uk-margin-large-top">Oops! Something went wrong!</h1>
<div class="uk-margin-large-bottom uk-margin-medium-top">
404 Error! The requested page was not found.
</div>
</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" uk-grid="">
</div>
</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">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-h4 uk-text-danger ">404 - Oops! Something went wrong!</h3>
<div class="middle-box loginscreen animated fadeInDown uk-text-left ">
<p class="uk-text-center">404 Error! The requested page was not found.</p>
</div>
</div>
</div>
</div>
</div>
<!-- CONTENT ENDS HERE -->
<!-- FOOTER STARTS HERE-->
<div class="custom-footer" style="z-index: 200;">
<div class="uk-section-primary uk-section uk-section-small">
<div class="uk-container">
<div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid="">
<div class="uk-width-1-1@m uk-first-column">
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-center">
<img alt="OpenAIRE" class="el-image" src="./images/Logo_Horizontal_white_small.png">
</div>
<div class="footer-license uk-margin uk-margin-remove-bottom uk-text-center uk-text-lead">
<div><a href="http://creativecommons.org/licenses/by/4.0/" target="_blank" rel="license"><img alt="Creative" src="./images/80x15.png" style="height: auto; max-width: 100%; vertical-align: middle;"></a>&nbsp;UNLESS OTHERWISE INDICATED, ALL MATERIALS CREATED BY THE OPENAIRE CONSORTIUM ARE LICENSED UNDER A&nbsp;<a href="http://creativecommons.org/licenses/by/4.0/" rel="license">CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE</a>.</div>
<div>OPENAIRE IS POWERED BY&nbsp;<a href="http://www.d-net.research-infrastructures.eu/">D-NET</a>.</div>
</div>
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-right">
<a class="uk-totop uk-icon" href="#" uk-scroll="" uk-totop="">
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- FOOTER ENDS HERE -->
</div>
</body>
</html>

View File

@ -1,82 +1,25 @@
<%--
Created by IntelliJ IDEA.
User: sofia
Date: 12/10/2017
Time: 5:15 μμ
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<% if (session.getAttribute("expiredVerificationCode") == null) {
String redirectURL = request.getContextPath() + "/error404.jsp";
response.sendRedirect(redirectURL);
} else if (session.getAttribute("expiredVerificationCode") != null) {
session.removeAttribute("expiredVerificationCode");
String redirectURL = request.getContextPath() + "/error404.jsp";
response.sendRedirect(redirectURL);
} else if (session.getAttribute("expiredVerificationCode") != null) {
session.removeAttribute("expiredVerificationCode");
}%>
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href=".">
<title>OpenAIRE - Expired Verification Code</title>
<script src="./js/jquery.js"></script>
<script src="./js/uikit.min.js"></script>
<script src="./js/validation.js"></script>
<link rel="stylesheet" style="text/css" href="./css/theme.css">
<link rel="stylesheet" style="text/css" href="./css/custom.css">
<link rel="stylesheet" style="text/css" href="./css/aai-custom.css">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="images/favicon//favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
</head>
<body class="" style="">
<div class="uk-offcanvas-content uk-height-viewport">
<div class="tm-header tm-header-transparent">
<div class="uk-container uk-container-expand">
<nav class="uk-navbar" uk-navbar="{&quot;align&quot;:&quot;left&quot;}">
<div class="uk-navbar-center">
<div class="uk-logo uk-navbar-item">
<img alt="OpenAIRE" class="uk-responsive-height" src="./images/Logo_Horizontal.png">
</div>
</div>
</nav>
</div>
</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>
</div>
<div class=" uk-section tm-middle custom-main-content" id="tm-main">
<div class="uk-container uk-container-small 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">Oops! Something went wrong</h3>--%>
<div class="middle-box loginscreen animated fadeInDown uk-text-center">
<p>Your verification code has expired. Please request for a new verification code <a href="./requestActivationCode.jsp">here</a>.</p>
</div>
</div>
</div>
</div>
</div>
<!-- CONTENT ENDS HERE -->
<!-- FOOTER STARTS HERE-->
<div class="custom-footer">
<div class="uk-section-primary uk-section uk-section-small uk-padding-remove-bottom">
<div class="uk-container">
<div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid="">
<div class="uk-width-expand@m uk-light uk-first-column">
FOOTER???
</div>
</div>
</div>
<jsp:include page="head.jsp">
<jsp:param name="title" value="OpenAIRE - Expired Verification Code"/>
</jsp:include>
<body>
<div class="uk-section uk-section-small uk-container uk-container-small">
<div class="uk-text-center">
<img src="images/Logo_Horizontal.png" style="height: 80px;">
<div class="uk-margin-large-top uk-text-warning">
<span class="material-icons" style="font-size: 180px;">alarm</span>
</div>
<div class="uk-text-large uk-text-bold uk-margin-medium-top">Your verification code has expired</div>
<div class="uk-margin-top">Please request for a new verification code <a href="./requestActivationCode.jsp">here</a>.</div>
</div>
</div>
</body>

View File

@ -1,119 +1,53 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OpenAIRE - Forgot password</title>
<script src="./js/jquery.js"></script>
<script src="./js/uikit.min.js"></script>
<link rel="stylesheet" style="text/css" href="./css/theme.css">
<link rel="stylesheet" style="text/css" href="./css/custom.css">
<link rel="stylesheet" style="text/css" href="./css/aai-custom.css">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="images/favicon//favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
<script src='https://www.google.com/recaptcha/api.js'></script>
</head>
<body class="" style="">
<div class="uk-offcanvas-content uk-height-viewport">
<!-- MENU STARTS HERE -->
<!-- MAIN MENU STARTS HERE -->
<div class="tm-header tm-header-transparent" uk-header="">
<div class="uk-container uk-container-expand">
<nav class="uk-navbar" uk-navbar="{&quot;align&quot;:&quot;left&quot;}">
<div class="uk-navbar-center">
<div class="uk-logo uk-navbar-item">
<img alt="OpenAIRE" class="uk-responsive-height" src="./images/Logo_Horizontal.png">
</div>
</div>
</nav>
</div>
<jsp:include page="head.jsp">
<jsp:param name="title" value="OpenAIRE - Forgot password"/>
<jsp:param name="form" value="true"/>
</jsp:include>
<body>
<div class="uk-section uk-section-small uk-container uk-container-small">
<div class="uk-text-center">
<img src="images/Logo_Horizontal.png" style="height: 80px;">
<h1 class="uk-h4 uk-margin-large-top">Forgot Password</h1>
<div class="uk-margin-large-bottom uk-margin-medium-top">
Please enter the <span class="uk-text-bolder">email address</span> of your account. A verification code will be
sent to you. Once you have received
the verification code, you will be able to choose a new password for your account.
</div>
<!-- MENU ENDS HERE -->
<!-- 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" uk-grid="">
</div>
</div>
<div class=" uk-section tm-middle custom-main-content" id="tm-main">
<div class="uk-container uk-container-small uk-margin-small-bottom uk-text-center">
<h2 class="uk-h2 uk-margin-small-bottom">Forgot Password</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 ">
<!-- CENTER SIDE -->
<div class="uk-width-1-1@m uk-width-1-1@s uk-text-center">
<!-- <h3 class="uk-h3">Create an account</h3> -->
<div class="middle-box text-center loginscreen animated fadeInDown ">
<p>Please enter the email address for your account. A verification code will be sent to you. Once you have received the verification code, you will be able to choose a new password for your account.</p>
<div class="uk-width-1-3@m uk-align-center">
<!-- REGISTER FORM -->
<div id="registerForm">
<form action="forgotPassword" method="POST" role="form" class="m-t" id="register_form">
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div class="alert alert-success" aria-hidden="true" style="display: none;"></div>
<div class="alert alert-danger" aria-hidden="true" style="display: none;"></div>
<div class="form-group">
<span id="server_error" class="uk-text-danger uk-text-small uk-float-left">${message}</span>
<c:remove var="message" scope="session" />
<span class="msg_email_error uk-text-danger uk-text-small uk-float-left" style="display:none">Please enter your email.</span>
<span class="msg_email_validation_error uk-text-danger uk-text-small uk-float-left" style="display:none">Please enter a valid email.</span>
<input id="email" name="email" type="text" placeholder="Email" class="form-control"></div>
<div class="uk-margin uk-grid-small uk-child-width-auto uk-grid uk-text-left uk-grid-stack" uk-grid="">
<div class="uk-width-1-1 uk-grid-margin uk-first-column">
<div class="g-recaptcha" data-sitekey=${applicationScope.sitekey}></div>
</div>
<div class="uk-width-1-1 uk-grid-margin uk-first-column">
<button type="submit" class="uk-button uk-button-primary" onclick="return validateForm();">Submit</button>
</div>
</div>
</form>
</div>
<script>
$("#email").focusin(function() {
$(this).removeClass('aai-form-danger');
$(".msg_email_error").fadeOut();
$(".msg_email_validation_error").fadeOut();
$("#server_error").fadeOut();
});
</script>
<!-- END OF REGISTER FORM -->
</div>
</ul>
</div>
</div>
<!-- END OF CENTER SIDE -->
</div>
</div>
</div>
</div>
</div>
<!-- CONTENT ENDS HERE -->
<!-- FOOTER STARTS HERE-->
<div class="custom-footer" style="z-index: 200;">
<div class="uk-section-primary uk-section uk-section-small">
<div class="uk-container">
<div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid="">
<div class="uk-width-1-1@m uk-first-column">
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-center">
<img alt="OpenAIRE" class="el-image" src="./images/Logo_Horizontal_white_small.png">
</div>
<div class="footer-license uk-margin uk-margin-remove-bottom uk-text-center uk-text-lead">
<div><a href="http://creativecommons.org/licenses/by/4.0/" target="_blank" rel="license"><img alt="Creative" src="./images/80x15.png" style="height: auto; max-width: 100%; vertical-align: middle;"></a>&nbsp;UNLESS OTHERWISE INDICATED, ALL MATERIALS CREATED BY THE OPENAIRE CONSORTIUM ARE LICENSED UNDER A&nbsp;<a href="http://creativecommons.org/licenses/by/4.0/" rel="license">CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE</a>.</div>
<div>OPENAIRE IS POWERED BY&nbsp;<a href="http://www.d-net.research-infrastructures.eu/">D-NET</a>.</div>
</div>
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-right">
<a class="uk-totop uk-icon" href="#" uk-scroll="" uk-totop="">
</a>
</div>
</div>
</div>
</div>
</div>
</div> <!-- FOOTER ENDS HERE -->
</div>
<form action="forgotPassword" method="POST" role="form"
class="uk-grid uk-child-width-1-1 uk-flex-column uk-flex-middle" uk-grid>
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div input id="email" class="uk-width-medium@s">
<div class="input-wrapper inner x-small">
<div class="input-box">
<div class="placeholder">
<label>Email <sup>*</sup></label>
</div>
<div class="uk-flex uk-flex-middle">
<input name="email" class="input uk-text-truncate">
</div>
</div>
</div>
</div>
<div class="uk-width-1-1 uk-flex uk-flex-center">
<div class="g-recaptcha" data-sitekey=${applicationScope.sitekey}></div>
</div>
<div class="uk-width-1-1 uk-text-center">
<div id="server_error" class="uk-text-danger uk-text-center uk-text-small uk-margin-bottom">${message}</div>
<c:remove var="message" scope="session" />
<button type="submit" class="uk-button uk-button-primary" onclick="return validateForm();">
Submit
</button>
</div>
</form>
</div>
</body>
<script>
$("#email input").focusin(function () {
$("#server_error").hide();
});
</script>
</html>

View File

@ -1,4 +1,5 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
@ -15,4 +16,7 @@
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon"/>
<script src='https://www.google.com/recaptcha/api.js'></script>
<c:if test="${param.form == true}">
<script src='js/input.js'></script>
</c:if>
</head>

View File

@ -0,0 +1,81 @@
$(document).ready(function () {
let inputs = $('[input]').toArray();
$(window).click(function () {
blur();
});
$.each(inputs, function (index, input) {
$(input).click(function (event) {
focus(input, index);
event.stopPropagation();
});
isActive(input);
});
function isActive(input) {
let textField = getTextField(input);
let wrapper = getWrapper(input);
if(textField.val().length > 0) {
if (wrapper) {
wrapper.addClass('active');
}
}
textField.on('input', function() {
if($(this).val().length > 0) {
wrapper.addClass('active');
} else {
wrapper.removeClass('active');
}
})
}
/**
* Focus current input and blur all the others in this page.
* */
function focus(input, index) {
let textField = getTextField(input);
if(textField) {
textField.focus();
let wrapper = getWrapper(input);
if (wrapper) {
wrapper.addClass('focused');
}
}
blur(index);
}
/**
* Blurs all inputs except of the given index;
* */
function blur(index = -1) {
$.each(inputs, function (j, input) {
let textField = getTextField(input);
if(textField && index !== j) {
textField.blur();
let wrapper = getWrapper(input);
if(wrapper) {
wrapper.removeClass('focused');
}
}
});
}
});
function getWrapper(input) {
return $(input).find('.input-wrapper');
}
/**
* Get the current textField
* Currently works for input and textarea
* */
function getTextField(input) {
let textField = $(input).find('input');
if(!textField) {
textField = $(input).find('textarea');
}
return textField;
}

View File

@ -1,222 +1,123 @@
function validateForm() {
var email = $("#email").val();
var email_conf = $("#email_conf").val();
var password = $("#password").val();
var password_conf = $("#password_conf").val();
var isValidEmail = validateEmail(email);
var isValidPassword = validatePassword(password);
var hasError = false;
var isUsernameFilled = false;
var isEmailFilled = false;
var isPasswordFilled = false;
let hasError = false;
// Check if first name is filled
if($("#first_name").val() != undefined) {
if($.trim($("#first_name").val()).length <= 0) {
$("#first_name").addClass('uk-input aai-form-danger');
$(".msg_first_name_error").show();
let firstNameInput = getTextField($("#first_name"));
if(firstNameInput.val() !== undefined) {
let wrapper = getWrapper("#first_name");
if($.trim(firstNameInput.val()).length <= 0) {
$("#msg_first_name_error").show();
wrapper.addClass('danger');
hasError = true;
} else {
$(".msg_first_name_error").hide();
$("#first_name").removeClass('aai-form-danger');
$("#msg_first_name_error").hide();
wrapper.removeClass('danger');
}
}
// Check if last name is filled
if($("#last_name").val() != undefined) {
if($.trim($("#last_name").val()).length <= 0) {
$("#last_name").addClass('uk-input aai-form-danger');
$(".msg_last_name_error").show();
let lastNameInput = getTextField($("#last_name"));
if(lastNameInput.val() !== undefined) {
let wrapper = getWrapper("#last_name");
if($.trim(lastNameInput.val()).length <= 0) {
$("#msg_last_name_error").show();
wrapper.addClass('danger');
hasError = true;
} else {
$(".msg_last_name_error").hide();
$("#last_name").removeClass('aai-form-danger');
$("#msg_last_name_error").hide();
wrapper.removeClass('danger');
}
}
// // Check if organization is filled
// if($("#organization").val() != undefined) {
// if($.trim($("#organization").val()).length <= 0) {
// $("#organization").addClass('uk-input aai-form-danger');
// $(".msg_organization_error").show();
// } else {
// $(".msg_organization_error").hide();
// $("#organization").removeClass('aai-form-danger');
// }
// }
// Check if username is filled
if($("#username").val() != undefined) {
if($.trim($("#username").val()).length <= 0) {
$("#username").addClass('uk-input aai-form-danger');
$(".msg_username_error").show();
let usernameInput = getTextField($("#username"));
if(usernameInput.val() !== undefined) {
let wrapper = getWrapper("#username");
if($.trim(usernameInput.val()).length <= 0) {
$("#msg_username_error").show();
wrapper.addClass('danger');
hasError = true;
} else {
isUsernameFilled = true;
$(".msg_username_error").hide();
$("#username").removeClass('aai-form-danger');
$("#msg_username_error").hide();
wrapper.removeClass('danger');
}
}
if($("#verification_code").val() != undefined) {
if($.trim($("#verification_code").val()).length <= 0) {
$("#verification_code").addClass('uk-input aai-form-danger');
$(".msg_verification_code_error").show();
$(".msg_activation_code_error").show();
// Check if verification code is filled
let verificationCodeInput = getTextField($("#verification_code"));
if(verificationCodeInput.val() !== undefined) {
let wrapper = getWrapper("#verification_code");
if($.trim(verificationCodeInput.val()).length <= 0) {
$("#msg_verification_code_error").show();
$("#msg_activation_code_error").show();
wrapper.addClass('danger');
hasError = true;
} else {
$(".msg_verification_code_error").hide();
$(".msg_activation_code_error").hide();
$("#verification_code").removeClass('aai-form-danger');
$("#msg_verification_code_error").hide();
$("#msg_activation_code_error").hide();
wrapper.removeClass('danger');
}
}
// Check if email is filled
if($("#email").val() != undefined) {
if($.trim($("#email").val()).length <= 0) {
$("#email").addClass('uk-input aai-form-danger');
$(".msg_email_error").show();
// Check if email is filled and valid
let emailInput = getTextField($("#email"));
let emailConfInput = getTextField($("#email_conf"));
if(emailInput.val() !== undefined) {
let wrapper = getWrapper("#email");
if($.trim(emailInput.val()).length <= 0) {
wrapper.addClass('danger');
hasError = true;
$("#msg_email_error").show();
} else {
isEmailFilled = true;
$(".msg_email_error").hide();
$("#email").removeClass('aai-form-danger');
}
}
// If email is filled
if (isEmailFilled) {
// Check if email is valid
if (!isValidEmail) {
$("#email").addClass('uk-input aai-form-danger');
$(".msg_email_validation_error").show();
hasError = true;
} else {
$(".msg_email_validation_error").hide();
$("#email").removeClass('aai-form-danger');
}
if ($("#email_conf").val() != undefined) {
// Check if emails match
if (isValidEmail && !confirm(email, email_conf)) {
$("#email").addClass('uk-input aai-form-danger');
$("#email_conf").addClass('uk-input aai-form-danger');
$(".msg_email_conf_error").show();
hasError = true;
$("#msg_email_error").hide();
if(validateEmail(emailInput.val())) {
$("#msg_email_validation_error").hide();
if(emailConfInput) {
let confWrapper = getWrapper('#email_conf')
if(!confirm(emailInput.val(), emailConfInput.val())) {
wrapper.addClass('danger');
confWrapper.addClass('danger');
$("#msg_email_conf_error").show();
hasError = true;
} else {
$("#msg_email_conf_error").hide();
wrapper.removeClass('danger');
confWrapper.removeClass('danger');
}
}
wrapper.removeClass('danger');
} else {
$(".msg_email_conf_error").hide();
$("#email").removeClass('aai-form-danger');
$("#email_conf").removeClass('aai-form-danger');
}
}
}
//Check if password is filled
if($("#password").val() != undefined) {
if($.trim($("#password").val()).length <= 0) {
$("#password").addClass('uk-input aai-form-danger');
$(".msg_password_error").show();
} else {
isPasswordFilled = true;
$(".msg_password_error").hide();
$("#password").removeClass('aai-form-danger');
$("#password_conf").removeClass('aai-form-danger');
}
if(isPasswordFilled) {
// Check if passwords match
if (!confirm(password, password_conf)) {
$("#password").addClass('uk-input aai-form-danger');
$("#password_conf").addClass('uk-input aai-form-danger');
$(".msg_pass_conf_error").show();
wrapper.addClass('danger');
$("#msg_email_validation_error").show();
hasError = true;
} else {
$(".msg_pass_conf_error").hide();
}
}
if(!isValidPassword) {
$("#password").addClass('uk-input aai-form-danger');
$(".msg_please_add").show();
$(".msg_lowercase_letter").show();
$(".msg_capital_letter").show();
$(".msg_number").show();
$(".msg_lenght").show();
hasError = true;
} else {
$("#password").removeClass('aai-form-danger');
$(".msg_please_add").hide();
$(".msg_lowercase_letter").hide();
$(".msg_capital_letter").hide();
$(".msg_number").hide();
$(".msg_lenght").hide();
}
}
var recaptcha = grecaptcha.getResponse();
if (recaptcha!=null && recaptcha !== undefined && recaptcha.length > 0) {
$(".recaptcha_error").hide();
//Check if password is filled and valid
let passwordInput = getTextField($("#password"));
let passwordConfInput = getTextField($("#password_conf"));
let validate = validatePassword(passwordInput.val(), passwordConfInput.val());
if(!hasError) {
hasError = !validate;
}
let recaptcha = grecaptcha.getResponse();
if (recaptcha != null && recaptcha.length > 0) {
$("#recaptcha_error").hide();
} else {
hasError = true;
$(".recaptcha_error").show();
$("#recaptcha_error").show();
}
return !hasError;
}
function validatePasswordForm() {
var password = $("#password").val();
var password_conf = $("#password_conf").val();
var isValidPassword = validatePassword(password);
var hasError = false;
var isPasswordFilled = false;
// Check if password is filled
if ($("#password").val() != undefined) {
if ($.trim($("#password").val()).length <= 0) {
$("#password").addClass('uk-input aai-form-danger');
$(".msg_password_error").show();
} else {
isPasswordFilled = true;
$(".msg_password_error").hide();
$("#password").removeClass('aai-form-danger');
$("#password_conf").removeClass('aai-form-danger');
}
if (isPasswordFilled) {
// Check if passwords match
if (!confirm(password, password_conf)) {
$("#password").addClass('uk-input aai-form-danger');
$("#password_conf").addClass('uk-input aai-form-danger');
$(".msg_pass_conf_error").show();
hasError = true;
} else {
$(".msg_pass_conf_error").hide();
}
}
if (!isValidPassword) {
$("#password").addClass('uk-input aai-form-danger');
$(".msg_please_add").show();
$(".msg_lowercase_letter").show();
$(".msg_capital_letter").show();
$(".msg_number").show();
$(".msg_lenght").show();
hasError = true;
} else {
$("#password").removeClass('aai-form-danger');
$(".msg_please_add").hide();
$(".msg_lowercase_letter").hide();
$(".msg_capital_letter").hide();
$(".msg_number").hide();
$(".msg_lenght").hide();
}
}
return !hasError;
let passwordInput = getTextField($("#password"));
let passwordConfInput = getTextField($("#password_conf"));
return validatePassword(passwordInput.val(), passwordConfInput.val());
}
function validateEmail(email) {
@ -224,16 +125,81 @@ function validateEmail(email) {
return re.test(email);
}
function validatePassword(password) {
var pattern = /^(?=.*[^a-zA-Z])(?=.*[a-z])(?=.*[A-Z])\S{6,}$/;
return pattern.test(password);
function validatePassword(password, confPassword = null) {
let space = /[\s]+/g;
let wrapper = getWrapper('#password');
wrapper.removeClass('danger');
$("#msg_pass_error").hide();
$("#msg_whitespace").hide();
$("#msg_lowercase_letter").hide();
$("#msg_uppercase_letter").hide();
$("#msg_number").hide();
$("#msg_length").hide();
if(password.length === 0) {
wrapper.addClass('danger');
$("#msg_pass_error").show();
return false;
} else {
$("#msg_pass_error").hide();
if (password.match(space)) {
wrapper.addClass('danger');
$("#msg_whitespace").show();
return false;
} else {
$("#msg_whitespace").hide();
let lowerCaseLetters = /[a-z]/g;
if (!password.match(lowerCaseLetters)) {
wrapper.addClass('danger');
$("#msg_lowercase_letter").show();
return false;
} else {
$("#msg_lowercase_letter").hide();
let upperCaseLetters = /[A-Z]/g;
if (!password.match(upperCaseLetters)) {
wrapper.addClass('danger');
$("#msg_uppercase_letter").show();
return false;
} else {
$("#msg_uppercase_letter").hide();
let numbers = /[0-9]/g;
if (!password.match(numbers)) {
wrapper.addClass('danger');
$("#msg_number").show();
return false;
} else {
$("#msg_number").hide();
if (password.length >= 6) {
$("#msg_length").hide();
wrapper.removeClass('danger');
} else {
wrapper.addClass('danger');
$("#msg_length").show();
return false;
}
}
}
}
}
if(confPassword) {
let confWrapper = getWrapper('#password_conf')
if(!confirm(password, confPassword)) {
wrapper.addClass('danger');
confWrapper.addClass('danger');
$("#msg_pass_conf_error").show();
return false;
} else {
$("#msg_pass_conf_error").hide();
wrapper.removeClass('danger');
confWrapper.removeClass('danger');
}
}
return true;
}
}
function confirm(first, second) {
if (first == second)
return true;
else
return false;
return first === second;
}
function loginForm(){

View File

@ -1,79 +0,0 @@
<%--
Created by IntelliJ IDEA.
User: sofia
Date: 19/10/2017
Time: 4:30 μμ
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href=".">
<title>OpenAIRE - APIs Authentication</title>
<script src="./js/jquery.js"></script>
<script src="./js/uikit.min.js"></script>
<script src="./js/validation.js"></script>
<script src="./js/uikit-icons-max.js"></script>
<link rel="stylesheet" style="text/css" href="./css/theme.css">
<link rel="stylesheet" style="text/css" href="./css/custom.css">
<link rel="stylesheet" style="text/css" href="./css/aai-custom.css">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="images/favicon//favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
</head>
<body class="" style="">
<div class="uk-offcanvas-content uk-height-viewport">
<!-- MENU STARTS HERE -->
<jsp:include page="header.jsp"/>
<!-- 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" uk-grid="">
</div>
</div>
<div class=" uk-section uk-margin-small-top uk-container " id="tm-main">
<div class="uk-text-center">
<!-- CENTER SIDE -->
<h2 class="uk-h2 uk-margin-small-bottom">OpenAIRE APIs Authentication</h2>
<div class="uk-margin-top">
The OpenAIRE APIs can be accessed over HTTPS both by authenticated and unauthenticated requests.
To achieve <b>better rate limits</b> you need to make <b>authenticated requests</b>.
</div>
<div class="uk-container uk-container-small uk-margin-top">
<div class="uk-alert-primary uk-alert uk-margin-top-remove">
<span uk-icon="info"></span>
<span class="uk-margin-small-left">For more information please read the <a href="https://graph.openaire.eu/develop/authentication.html" target="_blank">OpenAIRE API Authentication documentation</a>.</span>
</div>
<div class="uk-grid uk-child-width-1-2@m uk-child-width-1-1" uk-grid>
<div>
<div class="uk-card uk-card-default uk-card-body">
<div class=""> <a class="uk-link uk-text-large" href="./personalToken"> Personal token</a></div>
<div>Get access to the OpenAIRE APIs with your personal access and refresh token.</div>
</div>
</div>
<div>
<div class="uk-card uk-card-default uk-card-body ">
<div class=""> <a class="uk-link uk-text-large" href="./registeredServices"> Registered Services</a></div>
<div>Register your services to get access to the OpenAIRE APIs.</div>
</div>
</div>
</div>
</div>
<!-- END OF CENTER SIDE -->
</div>
</div>
<!-- CONTENT ENDS HERE -->
<c:import url="footer.jsp"/>
</div>
</body>
</html>

View File

@ -1,186 +0,0 @@
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OpenAIRE - Personal token</title>
<script src="./js/jquery.js"></script>
<script src="./js/uikit.min.js"></script>
<script src="./js/uikit-icons-max.js"></script>
<script>
function copy(id) {
var element = document.getElementById(id);
if (document.body.createTextRange) {
range = document.body.createTextRange();
range.moveToElementText(element);
range.select();
} else if (window.getSelection) {
selection = window.getSelection();
range = document.createRange();
range.selectNodeContents(element);
selection.removeAllRanges();
selection.addRange(range);
}
try {
document.execCommand('copy');
UIkit.notification({message: 'Copied to clipboard!', status: 'primary', pos: 'top-right'});
} catch (err) {
console.error('unable to copy text');
}
}
$(document).ready(function () {
document.addEventListener('copy', (event) => {
const selection = document.getSelection();
event.clipboardData.setData('text/plain', selection.toString().trim());
event.preventDefault();
});
});
</script>
<link rel="stylesheet" style="text/css" href="./css/theme.css">
<link rel="stylesheet" style="text/css" href="./css/custom.css">
<link rel="stylesheet" style="text/css" href="./css/aai-custom.css">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="images/favicon//favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon"/>
</head>
<body class="" style="">
<div class="uk-offcanvas-content uk-height-viewport">
<jsp:include page="header.jsp"/>
<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"
uk-grid="">
</div>
</div>
<div class=" uk-section uk-margin-small-top uk-container uk-container-large" id="tm-main">
<div class="uk-grid ">
<div class="uk-width-1-4@m">
<div class="uk-card uk-card-default uk-card-body">
<div class="uk-h4">API Access</div>
<ul class="uk-nav uk-nav-default">
<li class="uk-active"><a href="./personalToken">Personal token</a></li>
<li class=""><a href="./registeredServices">Registered services</a></li>
<%--<li class="uk-parent">
<a href="#">Parent</a>
<ul class="uk-nav-sub">
<li><a href="#">Sub item</a></li>
<li>
<a href="#">Sub item</a>
<ul>
<li><a href="#">Sub item</a></li>
<li><a href="#">Sub item</a></li>
</ul>
</li>
</ul>
</li>--%>
</ul>
</div>
</div>
<!-- CENTER SIDE -->
<div class="uk-width-2-3@l uk-width-2-3@m">
<div>
<span id="server_error" class="uk-text-danger uk-text-small uk-float-left">${message}</span>
<c:remove var="message" scope="session"/>
<div class="uk-alert-primary uk-margin-remove-top uk-alert uk-flex uk-flex-middle">
<span uk-icon="info"></span>
<span class="uk-margin-small-left">
For further information on how to use the tokens please visit the
<a href="https://graph.openaire.eu/develop/personalToken.html" target="_blank">OpenAIRE API Authentication documentation</a>.
</span>
</div>
<form id="revoke" name="revoke" action="./personalToken" method="post">
<!-- <a class=" uk-text-danger uk-float-right" title="Revoke access token" onClick="document.revoke.submit();"><span uk-icon="refresh" ></span></a> -->
<h4 class="uk-margin-remove-top uk-text-bold uk-text-primary">Your personal access token is</h4>
<div class="uk-flex uk-flex-middle uk-margin-bottom">
<div class="uk-width-expand">
<pre class="uk-margin-remove-bottom"><code id="accessToken">${accessToken}</code></pre>
</div>
<div class="uk-width-auto uk-padding-small uk-text-center">
<a onclick="copy('accessToken')"
title="Copy access token"><span uk-icon="copy"></span>
</a>
</div>
</div>
<div class="uk-flex uk-flex-middle">
<span uk-icon="info"></span>
<span class="uk-margin-small-left">
Your access token is <span class="uk-text-bold">valid for an hour</span>.
</span>
</div>
<div class="uk-text-danger uk-flex uk-flex-middle uk-margin-small-top">
<span uk-icon="warning"></span>
<span class="uk-margin-small-left">
Do not share your personal access token. Send your personal access token only over HTTPS.
</span>
</div>
</form>
</div>
<div class="uk-section">
<!--<a class=" uk-text-danger uk-float-right" title="Revoke refresh token"><span uk-icon="refresh"></span></a>-->
<c:choose>
<c:when test="${showRefreshToken == true}">
<h4 class="uk-margin-remove-top uk-text-bold uk-text-primary">Your refresh token is</h4>
<div class="uk-flex uk-flex-middle uk-margin-bottom">
<div class="uk-width-expand">
<pre class="uk-margin-remove-bottom"><code id="refreshToken">${refreshToken}</code></pre>
</div>
<div class="uk-width-auto uk-padding-small uk-text-center">
<a onclick="copy('refreshToken')"
title="Copy refreshToken token"><span uk-icon="copy"></span>
</a>
</div>
</div>
<div class="uk-flex uk-flex-middle">
<span uk-icon="info"></span>
<span class="uk-margin-small-left">OpenAIRE refresh token <span class="uk-text-bold">expires after 1 month</span> and allows you to programmatically get a new access token.</span>
</div>
<div class="uk-text-danger uk-flex uk-flex-middle uk-margin-small-top">
<span uk-icon="warning"></span>
<div class="uk-margin-small-left">
<div>Please copy your refresh token and store it confidentially. You will not be able to retrieve it.</div>
<div>Do not share your refresh token. Send your refresh token only over HTTPS.</div>
</div>
</div>
</c:when>
<c:otherwise>
<h4 class="uk-margin-remove-top uk-text-bold uk-text-primary">Do you need a refresh token?</h4>
<div class="uk-flex uk-flex-middle">
<span uk-icon="info"></span>
<span class="uk-margin-small-left">OpenAIRE refresh token <span class="uk-text-bold">expires after 1 month</span> and allows you to programmatically get a new access token.</span>
</div>
<button type="submit" class="uk-button uk-button-primary uk-margin-medium-top" uk-toggle="target: #refreshWarning">Get a
refresh token
</button>
</c:otherwise>
</c:choose>
</div>
<!-- This is the modal -->
<div id="refreshWarning" uk-modal>
<div class="uk-modal-dialog uk-modal-body">
<form id="refreshForm" action="./personalToken" method="POST">
<h2 class="uk-modal-title">Get refresh token</h2>
<p>In case you already have a refresh token, it will no longer be valid. Do you want to
proceed?</p>
<p class="uk-text-right">
<button class="uk-button uk-button-default uk-modal-close" type="button">Cancel</button>
<button class="uk-button uk-button-primary uk-margin-small-left" type="button" onclick="submit();">Get
refresh token
</button>
</p>
</form>
</div>
</div>
</div>
<!-- END OF CENTER SIDE -->
</div>
</div>
<!-- CONTENT ENDS HERE -->
<c:import url="footer.jsp"/>
</div>
</body>
</html>

View File

@ -1,359 +1,249 @@
<%--
Created by IntelliJ IDEA.
User: sofia
Date: 19/10/2017
Time: 4:30 μμ
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href=".">
<title>OpenAIRE - Register</title>
<script src="./js/jquery.js"></script>
<script src="./js/uikit.min.js"></script>
<script src="./js/validation.js"></script>
<script src="./js/uikit-icons-max.js"></script>
<link rel="stylesheet" style="text/css" href="./css/theme.css">
<link rel="stylesheet" style="text/css" href="./css/custom.css">
<link rel="stylesheet" style="text/css" href="./css/aai-custom.css">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="images/favicon//favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
<script src='https://www.google.com/recaptcha/api.js'></script>
</head>
<body class="" style="">
<div class="uk-offcanvas-content uk-height-viewport">
<!-- MENU STARTS HERE -->
<!-- MAIN MENU STARTS HERE -->
<div class="tm-header tm-header-transparent" uk-header="">
<div class="uk-container uk-container-expand">
<nav class="uk-navbar" uk-navbar="{&quot;align&quot;:&quot;left&quot;}">
<div class="uk-navbar-center">
<div class="uk-logo uk-navbar-item">
<img alt="OpenAIRE" class="uk-responsive-height" src="./images/Logo_Horizontal.png">
<jsp:include page="head.jsp">
<jsp:param name="title" value="OpenAIRE - Register"/>
<jsp:param name="form" value="true"/>
</jsp:include>
<body>
<div class="uk-section uk-section-small uk-container uk-container-small uk-flex uk-flex-column uk-flex-middle">
<div class="uk-text-center uk-margin-large-bottom">
<img src="images/Logo_Horizontal.png" style="height: 80px;">
<h1 class="uk-h4 uk-margin-large-top">Create a new OpenAIRE account</h1>
</div>
<form action="register" method="POST" role="form"
class="uk-grid uk-width-xlarge uk-child-width-1-2@m uk-child-width-1-1 uk-flex-top" uk-grid>
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div input id="first_name">
<div class="input-wrapper inner x-small">
<div class="input-box">
<div class="placeholder">
<label>First Name <sup>*</sup></label>
</div>
<div class="uk-flex uk-flex-middle">
<input name="first_name" class="input uk-text-truncate" value=${first_name}>
</div>
</div>
</nav>
</div>
<div id="msg_first_name_error" class="uk-text-danger uk-text-small" style="display: none;">Please enter your first name.</div>
<c:remove var="msg_first_name_error_display" scope="session" />
<c:remove var="first_name" scope="session" />
</div>
</div>
<!-- MENU ENDS HERE -->
<!-- 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" uk-grid="">
<div input id="last_name">
<div class="input-wrapper inner x-small">
<div class="input-box">
<div class="placeholder">
<label>Last Name <sup>*</sup></label>
</div>
<div class="uk-flex uk-flex-middle">
<input name="last_name" class="input uk-text-truncate" value=${last_name}>
</div>
</div>
</div>
<div id="msg_last_name_error" class="uk-text-danger uk-text-small" style="display: none;">Please enter your last name.</div>
<c:remove var="msg_last_name_error_display" scope="session" />
<c:remove var="last_name" scope="session" />
</div>
</div>
<div class=" uk-section tm-middle custom-main-content" id="tm-main">
<div class="uk-container uk-container-small uk-margin-small-bottom uk-text-center">
<h2 class="uk-h2 uk-margin-small-bottom">Create new OpenAIRE account</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-grid ">
<!-- CENTER SIDE -->
<div class="uk-width-1-1@m uk-width-1-1@s uk-text-center">
<h3 class="uk-h4">Create an account</h3>
<div class="middle-box text-center loginscreen animated fadeInDown ">
<div class="uk-width-1-3@m uk-align-center">
<!-- REGISTER FORM -->
<div id="registerForm">
<form action="register" method="POST" role="form" class="m-t" id="register_form">
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div class="alert alert-success" aria-hidden="true" style="display: none;"></div>
<div class="alert alert-danger" aria-hidden="true" style="display: none;"></div>
<span id="server_error" class="uk-text-danger uk-text-small uk-float-left">${message}</span>
<c:remove var="message" scope="session" />
<div class="form-group">
<span class="msg_first_name_error uk-text-danger uk-text-small uk-float-left" style="display:none;">Please enter your first name.</span>
<input id="first_name" name="first_name" type="text" placeholder="First name (*)" class="form-control" value=${first_name}></div>
<c:remove var="msg_first_name_error_display" scope="session" />
<c:remove var="first_name" scope="session" />
<div class="form-group">
<span class="msg_last_name_error uk-text-danger uk-text-small uk-float-left" style="display:none;">Please enter your last name.</span>
<input id="last_name" name="last_name" type="text" placeholder="Last name (*)" class="form-control" value=${last_name}></div>
<c:remove var="msg_last_name_error_display" scope="session" />
<c:remove var="last_name" scope="session" />
<div class="form-group">
<input id="organization" name="organization" type="text" placeholder="Affiliation / Organization:" class="form-control" value=${organization}></div>
<c:remove var="organization" scope="session" />
<div class="form-group">
<span class="msg_username_error uk-text-danger uk-text-small uk-float-left" style="display:none">Please enter your username.</span>
<span class="msg_username_min_lenght uk-text-danger uk-text-small uk-float-left" style="display:none">Minimum username length 5 characters.</span>
<span class="msg_username_max_lenght uk-text-danger uk-text-small uk-float-left" style="display:none">Maximum username length 150 characters.</span>
<span class="msg_username_start uk-text-danger uk-text-small uk-float-left" style="display:none">The username must start with letter or digit.</span>
<span class="msg_username_allowed_characters uk-text-danger uk-text-small uk-float-left" style="display:none">You can use letters, numbers, underscores, hyphens and periods.</span>
<span id="username_server_error" class="uk-text-danger uk-text-small uk-float-left">${username_message}</span>
<span id="username_allowed_chars_server_error" class="uk-text-danger uk-text-small uk-float-left">${username_allowed_chars_message}</span>
<span id="username_first_char_server_error" class="uk-text-danger uk-text-small uk-float-left">${username_first_char_message}</span>
<c:remove var="username_message" scope="session" />
<c:remove var="username_allowed_chars_message" scope="session" />
<c:remove var="username_first_char_message" scope="session" />
<input id="username" name="username" type="text" placeholder="Username (*)" class="form-control" value=${username}></div>
<c:remove var="username" scope="session" />
<div class="form-group">
<span class="msg_email_error uk-text-danger uk-text-small uk-float-left" style="display:none;">Please enter your email.</span>
<span class="msg_email_validation_error uk-text-danger uk-text-small uk-float-left" style="display:none;">Please enter a valid email.</span>
<span class="msg_email_conf_error uk-text-danger uk-text-small uk-float-left" style="display:none;">These emails don't match.</span>
<span id="email_server_error" class="uk-text-danger uk-text-small uk-float-left">${email_message}</span>
<c:remove var="msg_email_conf_error_display" scope="session" />
<c:remove var="msg_email_validation_error_display" scope="session" />
<c:remove var="email_message" scope="session" />
<input id="email" name="email" type="text" placeholder="Email (*)" class="form-control" value=${email}></div>
<c:remove var="email" scope="session" />
<c:remove var="msg_email_error_display" scope="session" />
<div class="form-group">
<input id="email_conf" name="email_conf" type="text" placeholder="Confirm email (*)" class="form-control" value=${email_conf}></div>
<c:remove var="email_conf" scope="session" />
<div class="form-group">
<span class="msg_password_error uk-text-danger uk-text-small uk-float-left" style="display:none;">Please enter your password.</span>
<span class="msg_pass_conf_error uk-text-danger uk-text-small uk-float-left" style="display:none;">These passwords don't match.</span>
<p>
<span class="msg_please_add uk-text-danger uk-text-small uk-float-left" style="display:none">Please add: &nbsp</span></p>
<span class="msg_lowercase_letter uk-text-danger uk-text-small uk-float-left" style="display:none">A lowercase letter. &nbsp</span>
<span class="msg_capital_letter uk-text-danger uk-text-small uk-float-left" style="display:none">A capital (uppercase) letter. &nbsp </span>
<span class="msg_number uk-text-danger uk-text-small uk-float-left" style="display:none">A number. &nbsp</span>
<span class="msg_lenght uk-text-danger uk-text-small uk-float-left" style="display:none">Minimum 6 characters. &nbsp</span>
<p><span class="msg_whitespace uk-text-danger uk-text-small uk-float-left" style="display:none">No white space allowed. &nbsp</span></p>
<span class="msg_invalid_password uk-text-danger uk-text-small uk-float-left" style="display:none;">The password must
contain a lowercase letter, a capital (uppercase) letter, a number and must be at least 6 characters long. White space character is not allowed.</span>
<input id="password" name="password" type="password" placeholder="Password" class="form-control"></div>
<c:remove var="msg_pass_conf_error_display" scope="session" />
<c:remove var="msg_password_error_display" scope="session" />
<c:remove var="msg_invalid_password_display" scope="session" />
<div class="form-group">
<input id="password_conf" name="password_conf" type="password" placeholder="Confirm password" class="form-control"></div>
<div class="uk-margin uk-grid-small uk-child-width-auto uk-grid uk-text-left uk-grid-stack" uk-grid="">
<div class="uk-width-1-1 uk-text-meta uk-text-danger uk-first-column">(*) Required fields</div>
<span class="uk-text-danger uk-text-small recaptcha_error" style="display:none;">You missed the reCAPTCHA validation!</span>
<c:remove var="recaptcha_error_display" scope="session" />
<div class="g-recaptcha" data-sitekey=${applicationScope.sitekey}></div>
<div class="uk-width-1-1 uk-grid-margin uk-first-column">
<button type="submit" class="uk-button uk-button-primary" onclick="return validateForm();">Register</button>
</div>
</div>
</form>
</div>
<!-- END OF REGISTER FORM -->
<script>
var myInput = document.getElementById("password");
var usernameInput = document.getElementById("username");
//var myEmailInput = document.getElementById("email");
$("#password").focusin(function () {
$(".msg_invalid_password").fadeOut();
});
// When the user starts to type something inside the password field
myInput.onkeyup = function() {
var space = /[\s]+/g;
if (myInput.value.match(space)) {
$(".msg_whitespace").fadeIn();
} else {
$(".msg_whitespace").fadeOut();
}
// Validate lowercase letters
var lowerCaseLetters = /[a-z]/g;
if (myInput.value.match(lowerCaseLetters)) {
$(".msg_lowercase_letter").fadeOut();
} else {
$(".msg_lowercase_letter").fadeIn();
}
// Validate capital letters
var upperCaseLetters = /[A-Z]/g;
if (myInput.value.match(upperCaseLetters)) {
$(".msg_capital_letter").fadeOut();
} else {
$(".msg_capital_letter").fadeIn();
}
// Validate numbers
var numbers = /[0-9]/g;
if (myInput.value.match(numbers)) {
$(".msg_number").fadeOut();
} else {
$(".msg_number").fadeIn();
}
// Validate length
if (myInput.value.length >= 6) {
$(".msg_lenght").fadeOut();
} else {
$(".msg_lenght").fadeIn();
}
if(myInput.value.match(lowerCaseLetters) && myInput.value.match(upperCaseLetters)
&& myInput.value.match(numbers) && (myInput.value.length >= 6)){
if($(".msg_please_add").css('display')!='none'){
$(".msg_please_add").fadeOut();
}
} else {
if($(".msg_please_add").css('display')=='none') {
$(".msg_please_add").fadeIn();
}
}
}
usernameInput.onkeyup = function() {
// Validate username minimum length
if (usernameInput.value.length >= 5) {
$(".msg_username_min_lenght").fadeOut();
} else {
$(".msg_username_min_lenght").fadeIn();
}
// Validate username maximum length
if (usernameInput.value.length < 150) {
$(".msg_username_max_lenght").fadeOut();
} else {
$(".msg_username_max_lenght").fadeIn();
}
var allowedChars = /^[a-zA-Z0-9._-]*$/;
if (usernameInput.value.match(allowedChars)) {
$(".msg_username_allowed_characters").fadeOut();
} else {
$(".msg_username_allowed_characters").fadeIn();
}
var startsWith = /^[a-zA-Z0-9].*/;
if (usernameInput.value.match(startsWith)) {
$(".msg_username_start").fadeOut();
} else {
$(".msg_username_start").fadeIn();
}
}
$("#first_name").focusin(function () {
$(this).removeClass('aai-form-danger');
$(".msg_first_name_error").fadeOut();
});
$("#last_name").focusin(function () {
$(this).removeClass('aai-form-danger');
$(".msg_last_name_error").fadeOut();
});
$("#username").focusin(function () {
$(this).removeClass('aai-form-danger');
$(".msg_username_error").fadeOut();
$("#username_server_error").fadeOut();
$("#username_allowed_chars_server_error").fadeOut();
$("#username_first_char_server_error").fadeOut();
});
$("#email").focusin(function () {
$(this).removeClass('aai-form-danger');
$(".msg_email_error").fadeOut();
$(".msg_email_validation_error").fadeOut();
$("#email_server_error").fadeOut();
});
$("#email_conf").focusin(function () {
$(this).removeClass('aai-form-danger');
$(".msg_email_conf_error").fadeOut();
});
$("#password").focusin(function () {
$(this).removeClass('aai-form-danger');
$(".msg_please_add").fadeOut();
$(".msg_password_error").fadeOut();
$(".msg_pass_conf_error").fadeOut();
$(".msg_lowercase_letter").fadeOut();
$(".msg_capital_letter").fadeOut();
$(".msg_number").fadeOut();
$(".msg_lenght").fadeOut();
});
$("#password_conf").focusin(function () {
$(this).removeClass('aai-form-danger');
$(".msg_pass_conf_error").fadeOut();
});
// // Run on page load
// window.onload = function() {
//
//// // If sessionStorage is storing default values (ex. name), exit the function and do not restore data
//// if (sessionStorage.getItem('name') == "name") {
//// return;
//// }
//
// // If values are not blank, restore them to the fields
//
// var first_name = sessionStorage.getItem('first_name');
// if (first_name !== null) $('#first_name').val(first_name);
//
// var last_name = sessionStorage.getItem('last_name');
// if (last_name !== null) $('#last_name').val(last_name);
//
// var organization = sessionStorage.getItem('organization');
// if (organization !== null) $('#organization').val(organization);
//
// var username = sessionStorage.getItem('username');
// if (username !== null) $('#username').val(username);
//
// var email = sessionStorage.getItem('email');
// if (email !== null) $('#email').val(email);
//
// var email_conf= sessionStorage.getItem('email_conf');
// if (email_conf!== null) $('#email_conf').val(email_conf);
//
//
// }
//
// // Before refreshing the page, save the form data to sessionStorage
// window.onbeforeunload = function() {
// sessionStorage.setItem("first_name", $('#first_name').val());
// sessionStorage.setItem("last_name", $('#last_name').val());
// sessionStorage.setItem("organization", $('#organization').val());
// sessionStorage.setItem("username", $('#username').val());
// sessionStorage.setItem("email", $('#email').val());
// sessionStorage.setItem("email_conf", $('#email_conf').val());
// }
</script>
</div>
</ul>
</div>
</div>
<!-- END OF CENTER SIDE -->
<div input id="organization">
<div class="input-wrapper inner x-small">
<div class="input-box">
<div class="placeholder">
<label>Affiliation / Organization</label>
</div>
<div class="uk-flex uk-flex-middle">
<input name="organization" class="input uk-text-truncate" value=${organization}>
</div>
</div>
<c:remove var="organization" scope="session" />
</div>
</div>
<div input id="username">
<div class="input-wrapper inner x-small">
<div class="input-box">
<div class="placeholder">
<label>Username <sup>*</sup></label>
</div>
<div class="uk-flex uk-flex-middle">
<input name="username" class="input uk-text-truncate" value=${username}>
</div>
</div>
</div>
<div id="msg_username_error" class="uk-text-danger uk-text-small" style="display: none;">Please enter your username.</div>
<div id="msg_username_min_length" class="uk-text-danger uk-text-small" style="display: none;">Minimum username length 5 characters.</div>
<div id="msg_username_max_length" class="uk-text-danger uk-text-small" style="display: none;">Maximum username length 150 characters.</div>
<div id="msg_username_start" class="uk-text-danger uk-text-small" style="display: none;">Username must start with a letter or digit.</div>
<div id="msg_username_allowed_characters" class="uk-text-danger uk-text-small" style="display: none;">You can use letters, numbers, underscores, hyphens and periods.</div>
<div id="username_server_error" class="uk-text-danger uk-text-small">${username_message}</div>
<div id="username_allowed_chars_server_error" class="uk-text-danger uk-text-small">${username_allowed_chars_message}</div>
<div id="username_first_char_server_error" class="uk-text-danger uk-text-small">${username_first_char_message}</div>
<c:remove var="username" scope="session" />
<c:remove var="username_message" scope="session" />
<c:remove var="username_allowed_chars_message" scope="session" />
<c:remove var="username_first_char_message" scope="session" />
</div>
<div input id="email">
<div class="input-wrapper inner x-small">
<div class="input-box">
<div class="placeholder">
<label>Email <sup>*</sup></label>
</div>
<div class="uk-flex uk-flex-middle">
<input name="email" class="input uk-text-truncate" value=${email}>
</div>
</div>
</div>
<div id="msg_email_error" class="uk-text-danger uk-text-small" style="display: none;">Please enter your email.</div>
<div id="msg_email_validation_error" class="uk-text-danger uk-text-small" style="display: none;">Please enter a valid email.</div>
<div id="msg_email_conf_error" class="uk-text-danger uk-text-small" style="display: none;">The emails don't match.</div>
<div id="email_server_error" class="uk-text-danger uk-text-small">${email_message}</div>
<c:remove var="email" scope="session" />
<c:remove var="msg_email_error_display" scope="session" />
<c:remove var="msg_email_conf_error_display" scope="session" />
<c:remove var="msg_email_validation_error_display" scope="session" />
<c:remove var="email_message" scope="session" />
</div>
<div input id="email_conf">
<div class="input-wrapper inner x-small">
<div class="input-box">
<div class="placeholder">
<label>Confirm Email <sup>*</sup></label>
</div>
<div class="uk-flex uk-flex-middle">
<input name="email_conf" class="input uk-text-truncate" value=${email_conf}>
</div>
</div>
</div>
<c:remove var="email_conf" scope="session" />
</div>
<div input id="password">
<div class="input-wrapper inner x-small">
<div class="input-box">
<div class="placeholder">
<label>Password <sup>*</sup></label>
</div>
<div class="uk-flex uk-flex-middle">
<input name="password" type="password" class="input uk-text-truncate">
</div>
</div>
</div>
<div id="msg_pass_error" class="uk-text-danger uk-text-small" style="display: none;">Please enter your password.</div>
<div id="msg_pass_conf_error" class="uk-text-danger uk-text-small" style="display: none;">The passwords don't match.</div>
<div id="msg_whitespace" class="uk-text-danger uk-text-small" style="display: none;">No white space allowed.</div>
<div id="msg_lowercase_letter" class="uk-text-danger uk-text-small" style="display: none;">Please add a lowercase letter.</div>
<div id="msg_uppercase_letter" class="uk-text-danger uk-text-small" style="display: none;">Please add an uppercase letter.</div>
<div id="msg_number" class="uk-text-danger uk-text-small" style="display: none;">Please add a number.</div>
<div id="msg_length" class="uk-text-danger uk-text-small" style="display: none;">Must contains at least 6 characters.</div>
<div id="msg_invalid_password" class="uk-text-danger uk-text-small" style="display: none;">
The password must contain a lowercase letter, a capital (uppercase) letter, a number and must be at least 6 characters long. White space character is not allowed.
</div>
<c:remove var="msg_pass_conf_error_display" scope="session" />
<c:remove var="msg_password_error_display" scope="session" />
<c:remove var="msg_invalid_password_display" scope="session" />
</div>
<div input id="password_conf">
<div class="input-wrapper inner x-small">
<div class="input-box">
<div class="placeholder">
<label>Confirm Password <sup>*</sup></label>
</div>
<div class="uk-flex uk-flex-middle">
<input name="password_conf" type="password" class="input uk-text-truncate">
</div>
</div>
</div>
</div>
</div>
<!-- CONTENT ENDS HERE -->
<!-- FOOTER STARTS HERE-->
<div class="custom-footer" style="z-index: 200;">
<div class="uk-section-primary uk-section uk-section-small">
<div class="uk-container">
<div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid="">
<div class="uk-width-1-1@m uk-first-column">
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-center">
<img alt="OpenAIRE" class="el-image" src="./images/Logo_Horizontal_white_small.png">
</div>
<div class="footer-license uk-margin uk-margin-remove-bottom uk-text-center uk-text-lead">
<div><a href="http://creativecommons.org/licenses/by/4.0/" target="_blank" rel="license"><img alt="Creative" src="./images/80x15.png" style="height: auto; max-width: 100%; vertical-align: middle;"></a>&nbsp;UNLESS OTHERWISE INDICATED, ALL MATERIALS CREATED BY THE OPENAIRE CONSORTIUM ARE LICENSED UNDER A&nbsp;<a href="http://creativecommons.org/licenses/by/4.0/" rel="license">CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE</a>.</div>
<div>OPENAIRE IS POWERED BY&nbsp;<a href="http://www.d-net.research-infrastructures.eu/">D-NET</a>.</div>
</div>
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-right">
<a class="uk-totop uk-icon" href="#" uk-scroll="" uk-totop="">
</a>
</div>
</div>
</div>
<div class="uk-width-1-1 uk-flex uk-flex-center">
<div class="uk-text-center">
<span id="recaptcha_error" class="uk-text-danger uk-text-small" style="display:none;">You missed the reCAPTCHA validation!</span>
<div class="g-recaptcha" data-sitekey=${applicationScope.sitekey}></div>
</div>
</div>
<c:remove var="recaptcha_error_display" scope="session" />
</div>
<div class="uk-width-1-1 uk-text-center">
<div id="server_error" class="uk-text-danger uk-text-center uk-text-small uk-margin-bottom">${message}</div>
<c:remove var="message" scope="session" />
<button type="submit" class="uk-button uk-button-primary" onclick="return validateForm();">
Register
</button>
</div>
</form>
</div>
</body>
<script>
$("input").focusin(function () {
$("#server_error").hide();
});
// On the fly check for username validation
let username = $("#username input")[0];
username.onkeyup = function () {
if (username.value.length < 5) {
$("#msg_username_min_length").show();
} else {
$("#msg_username_min_length").hide();
if (username.value.length >= 150) {
$("#msg_username_min_length").show();
} else {
$("#msg_username_min_length").hide();
let allowedChars = /^[a-zA-Z0-9._-]*$/;
if (!username.value.match(allowedChars)) {
$("#msg_username_allowed_characters").show();
} else {
$("#msg_username_allowed_characters").hide();
let startsWith = /^[a-zA-Z0-9].*/;
if (!username.value.match(startsWith)) {
$("#msg_username_start").show();
} else {
$("#msg_username_start").hide();
}
}
}
}
};
// On the fly check for password validation
let password = $("#password input")[0];
password.onkeyup = function () {
validatePassword(password.value);
};
$("#first_name input").focusin(function () {
$("#msg_first_name_error").hide();
});
$("#last_name input").focusin(function () {
$("#msg_last_name_error").hide();
});
$("#username input").focusin(function () {
$("#msg_username_error").hide();
$("#username_server_error").hide();
$("#username_allowed_chars_server_error").hide();
$("#username_first_char_server_error").hide();
});
$("#email input").focusin(function () {
$("#msg_email_error").hide();
$("#msg_email_validation_error").hide();
$("#email_server_error").hide();
});
$("#email_conf input").focusin(function () {
$("#msg_email_conf_error").hide();
});
$("#password input").focusin(function () {
$("#msg_password_error").hide();
$("#msg_pass_conf_error").hide();
$("#msg_lowercase_letter").hide();
$("#msg_capital_letter").hide();
$("#msg_number").hide();
$("#msg_length").hide();
});
$("#password_conf input").focusin(function () {
$("#msg_pass_conf_error").hide();
});
</script>
</html>

View File

@ -1,314 +0,0 @@
<%--
Created by IntelliJ IDEA.
User: sofia
Date: 19/10/2017
Time: 4:30 μμ
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href=".">
<title>OpenAIRE - Register</title>
<script src="./js/jquery.js"></script>
<script src="./js/uikit.min.js"></script>
<script src="./js/uikit-icons-max.js"></script>
<link rel="stylesheet" style="text/css" href="./css/theme.css">
<link rel="stylesheet" style="text/css" href="./css/custom.css">
<link rel="stylesheet" style="text/css" href="./css/aai-custom.css">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="images/favicon//favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon"/>
</head>
<body class="" style="">
<div class="uk-offcanvas-content uk-height-viewport">
<jsp:include page="header.jsp"/>
<!-- CONTENT STARTS HERE -->
<div class=" uk-section uk-margin-small-top uk-container uk-container-large" id="tm-main">
<div class="uk-grid ">
<div class="uk-width-1-4@m">
<div class="uk-card uk-card-default uk-card-body">
<div class="uk-h4">API Access</div>
<ul class="uk-nav uk-nav-default">
<li class=""><a href="./personalToken">Personal token</a></li>
<li class=""><a href="./registeredServices">Registered services</a></li>
</ul>
</div>
</div>
<!-- CENTER SIDE -->
<div class="uk-width-2-3@l uk-width-2-3@m">
<c:choose>
<c:when test="${not empty param.id}">
<h4 class="uk-margin-remove-top uk-text-bold uk-text-primary">Edit service</h4>
</c:when>
<c:otherwise>
<h4 class="uk-margin-remove-top uk-text-bold uk-text-primary">Add a new service</h4>
</c:otherwise>
</c:choose>
<!-- REGISTER FORM -->
<div id="registerForm">
<form action="registerService" method="POST" role="form" class="m-t uk-form-horizontal"
id="register_form">
<input type="hidden" name="id" value="${param.id}"/>
<c:choose>
<c:when test = "${not empty param.id}">
<input type="hidden" name="mode" value="edit"/>
</c:when>
<c:otherwise>
<input type="hidden" name="mode" value="create"/>
</c:otherwise>
</c:choose>
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div class="alert alert-success" aria-hidden="true" style="display: none;"></div>
<div class="alert alert-danger" aria-hidden="true" style="display: none;"></div>
<div class="uk-margin-medium-top">
<label class="uk-form-label uk-text-bold" for="first_name">Name*</label>
<div class="uk-margin-small">Give a name to your service</div>
<input id="first_name" name="first_name" type="text" placeholder="Name (*)"
class="uk-input ${first_name_error == true?'uk-form-danger':''}"
onkeyup="validate()" onfocusout="nameTouched = true;validate()" value="${(first_name != null)?first_name:''}">
<c:choose>
<c:when test="${first_name_error == true}">
<div id="first_name_error" class="uk-text-danger uk-text-small">Please enter a name for your service.
</div>
</c:when>
<c:otherwise>
<div id="first_name_error" style="display:none;" class="uk-text-danger uk-text-small">Please enter a name for your service.</div>
</c:otherwise>
</c:choose>
<c:remove var="first_name" scope="session"/>
<c:remove var="first_name_error" scope="session"/>
</div>
<div class="uk-margin-medium-top">
<label class="uk-form-label uk-text-bold">Security level</label>
<div id="security-hint" class="uk-margin"></div>
<div class="uk-margin-small-top">
<span class="uk-margin-small-right">
<input id="basic" class="uk-radio uk-margin-small-right" type="radio"
name="security_level"
value="basic" ${key_type == null ? 'checked' : ''}>
<label class="clickable" for="by_value">Basic</label>
</span>
<span>
<input id="advanced" class="uk-radio uk-margin-small-right" type="radio"
name="security_level" value="advanced" ${key_type != null ? 'checked' : ''}>
<label class="clickable" for="by_uri">Advanced</label>
</span>
</div>
</div>
<div id="public-key" class="uk-margin-medium-top">
<label class="uk-form-label uk-text-bold">Public Key</label>
<span class="uk-float-right">
<span class="uk-margin-small-right">
<input id="by_value" class="uk-radio uk-margin-small-right" type="radio"
name="key_type"
value="value" ${(key_type == 'value') ? 'checked' : ''}>
<label class="clickable" for="by_value">By Value</label>
</span>
<span>
<input id="by_uri" class="uk-radio uk-margin-small-right" type="radio"
name="key_type"
value="uri" ${key_type == 'uri' ? 'checked' : ''}>
<label class="clickable" for="by_uri">By URI</label>
</span>
</span>
<c:remove var="key_type" scope="session"/>
<div class="uk-margin">Public Key hint</div>
<div id="value_input">
<textarea id="value" name="value" type="textarea"
placeholder='{"kty": ..., "e": ... , "use": ... , "kid": ..., "alg": ... , "n": ...}'
onfocusout="valueTouched = true;validate()"
onkeyup="validate()"
class="uk-textarea ${value_error == true?'uk-form-danger':''}" rows="10">${(value != null)?value:''}</textarea>
<c:choose>
<c:when test="${value_error == true}">
<div id="value_error" class="uk-text-danger uk-text-small">Please provide a valid JSON. The format should be
{"kty": ..., "e": ... , "use": ... , "kid": ..., "alg": ... , "n": ...} </div>
<c:remove var="value_error" scope="session"/>
</c:when>
<c:otherwise>
<div id="value_error" style="display:none;" class="uk-text-danger uk-text-small">Please provide a valid JSON. The format should be
{"kty": ..., "e": ... , "use": ... , "kid": ..., "alg": ... , "n": ...} </div>
</c:otherwise>
</c:choose>
<c:remove var="value" scope="session"/>
</div>
<div id="uri_input" style="display:none;">
<input id="uri" name="uri" type="text" placeholder="https://" onfocusout="uriTouched = true;validate()"
onkeyup="validate()"
class="uk-input ${uri_error == true?'uk-form-danger':''}" value="${(jwksUri != null)?jwksUri:''}">
<c:choose>
<c:when test="${uri_error == true}">
<div id="uri_error" class="uk-text-danger uk-text-small">
Please provide a valid URI (do not forget the protocol! https://...)
</div>
<c:remove var="uri_error" scope="session"/>
</c:when>
<c:otherwise>
<div id="uri_error" style="display:none;" class="uk-text-danger uk-text-small">
Please provide a valid URI (do not forget the protocol! https://...)
</div>
</c:otherwise>
</c:choose>
<c:remove var="jwksUri" scope="session"/>
</div>
</div>
<div class="uk-flex uk-flex-right uk-margin-medium-top">
<a type="submit" class="uk-button uk-button-default uk-margin-small-right"
href="./registeredServices">Cancel</a>
<button id="create" type="submit" class="uk-button uk-button-primary" onclick="return validate();">
<c:choose>
<c:when test="${not empty param.id}">
Update service
</c:when>
<c:otherwise>
Add new service
</c:otherwise>
</c:choose>
</button>
</div>
</form>
</div>
<!-- END OF REGISTER FORM -->
</ul>
</div>
<!-- END OF CENTER SIDE -->
</div>
</div>
<!-- CONTENT ENDS HERE -->
<c:import url="footer.jsp"/>
</div>
</body>
</html>
<script>
var nameTouched = false;
var valueTouched = false;
var uriTouched = false;
$(document).ready(function () {
checkRadio();
if($('input[name=mode]').val() === 'edit') {
$("#basic").prop("disabled", true);
$("#advanced").prop("disabled", true);
}
if($('#value_error').is(':visible')) {
$("#value_input").get(0).scrollIntoView();
} else if($('#uri_error').is(':visible')) {
$("#uri_input").get(0).scrollIntoView();
}
$('input[type=radio][name=security_level]').change(function () {
var securityLevel = $('input[type=radio][name=security_level]:checked').val();
if(securityLevel === 'advanced') {
$("#by_value").prop("checked", true);
} else {
$("#by_value").prop("checked", false);
$("#by_uri").prop("checked", false);
}
checkRadio();
});
$('input[type=radio][name=key_type]').change(function () {
checkRadio();
});
});
function checkRadio() {
var securityLevel = $('input[type=radio][name=security_level]:checked').val();
if(securityLevel === 'basic') {
$("#security-hint").html('Register your service to get a client id and a client secret. Use the client id and secret to make your requests. <a href="https://graph.openaire.eu/develop/basic.html" target="_blank">Read more...</a>');
$("#public-key").hide();
} else {
$("#security-hint").html('Register your service to get a client id. Declare your public key and instead of using the client secret to make a request, send a client assertion (JWT) signed with your private key. <a href="https://graph.openaire.eu/develop/advanced.html" target="_blank">Read more...</a>');
var keyType = $('input[type=radio][name=key_type]:checked').val();
$("#public-key").show();
if (keyType === 'uri') {
$("#uri_input").show();
$("#value_input").hide();
} else if (keyType === 'value') {
$("#uri_input").hide();
$("#value_input").show();
}
}
validate();
}
function validate() {
var isValid = true;
var create = $('#create');
create.prop('disabled', true);
var name = $("#first_name");
if (name.val() !== undefined) {
if ($.trim(name.val()).length <= 0) {
if (nameTouched) {
name.addClass('uk-form-danger');
$("#first_name_error").show();
}
isValid = false;
} else {
if (nameTouched) {
name.removeClass('uk-form-danger');
$("#first_name_error").hide();
}
}
}
var securityLevel = $('input[type=radio][name=security_level]:checked').val();
if(securityLevel === 'advanced') {
var keyType = $('input[type=radio][name=key_type]:checked');
if (keyType.val() === 'value') {
if (!validateJSON()) {
if (valueTouched) {
$("#value").addClass('uk-form-danger');
$("#value_error").show();
}
isValid = false;
} else {
if (valueTouched) {
$("#value").removeClass('uk-form-danger');
$("#value_error").hide();
}
}
}
if (keyType.val() === 'uri') {
if (!validateURI()) {
if (uriTouched) {
$("#uri").addClass('uk-form-danger');
$("#uri_error").show();
}
isValid = false;
} else {
if (uriTouched) {
$("#uri").removeClass('uk-form-danger');
$("#uri_error").hide();
}
}
}
}
if (isValid) {
create.prop('disabled', false);
}
return isValid;
}
function validateJSON() {
var value = $("#value").val();
if (value !== undefined && value !== "") {
return /^[\],:{}\s]*$/.test(value.replace(/\\["\\\/bfnrtu]/g, '@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').replace(/(?:^|:|,)(?:\s*\[)+/g, ''));
}
return false;
}
function validateURI() {
var value = $("#uri").val();
if (value !== undefined && value !== "") {
return /^(?:(?:(?:https):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(value);
}
return false;
}
</script>

View File

@ -1,105 +1,26 @@
<%--
Created by IntelliJ IDEA.
User: sofia
Date: 1/11/2017
Time: 12:44 μμ
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<% if (session.getAttribute("registerSuccess") == null) {
String redirectURL = request.getContextPath() + "/error404.jsp";
response.sendRedirect(redirectURL);
} else if (session.getAttribute("registerSuccess") != null) {
session.removeAttribute("registerSuccess");
String redirectURL = request.getContextPath() + "/error404.jsp";
response.sendRedirect(redirectURL);
} else if (session.getAttribute("registerSuccess") != null) {
session.removeAttribute("registerSuccess");
}%>
<%--<META HTTP-EQUIV=Refresh CONTENT="0.5; URL=http://beta.services.openaire.eu/uoa-user-management/openid_connect_login">--%>
<META HTTP-EQUIV=Refresh CONTENT='0.5; URL=<%= session.getAttribute("homeUrl")%>'>
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OpenAIRE - Successful registration</title>
<script src="./js/jquery.js"></script>
<script src="./js/uikit.min.js"></script>
<script src="./js/validation.js"></script>
<link rel="stylesheet" style="text/css" href="./css/theme.css">
<link rel="stylesheet" style="text/css" href="./css/custom.css">
<link rel="stylesheet" style="text/css" href="./css/aai-custom.css">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="images/favicon//favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
</head>
<body class="" style="">
<div class="uk-offcanvas-content uk-height-viewport">
<!-- MENU STARTS HERE -->
<!-- MAIN MENU STARTS HERE -->
<div class="tm-header tm-header-transparent" uk-header="">
<div class="uk-container uk-container-expand">
<nav class="uk-navbar" uk-navbar="{&quot;align&quot;:&quot;left&quot;}">
<div class="uk-navbar-center">
<div class="uk-logo uk-navbar-item">
<img alt="OpenAIRE" class="uk-responsive-height" src="./images/Logo_Horizontal.png">
</div>
</div>
</nav>
<jsp:include page="head.jsp">
<jsp:param name="title" value="OpenAIRE - Successful registration"/>
</jsp:include>
<body>
<div class="uk-section uk-section-small uk-container uk-container-small">
<div class="uk-text-center">
<img src="images/Logo_Horizontal.png" style="height: 80px;">
<div class="uk-margin-large-top uk-text-success">
<span class="material-icons" style="font-size: 180px;">check</span>
</div>
<div class="uk-text-large uk-text-bold uk-margin-medium-top">Your account has been successfully activated!</div>
</div>
<!-- MENU ENDS HERE -->
<!-- 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" uk-grid="">
</div>
</div>
<div class=" uk-section tm-middle custom-main-content" id="tm-main">
<div class="uk-container uk-container-small uk-margin-small-bottom uk-text-center">
<%--<h2 class="uk-h2 uk-margin-small-bottom">Forgot Password</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 ">
<!-- CENTER SIDE -->
<div class="uk-width-1-1@m uk-width-1-1@s uk-text-center">
<!-- <h3 class="uk-h3">Create an account</h3> -->
<div class="middle-box text-center loginscreen animated fadeInDown ">
<h3 class="uk-h4 uk-text-success">Your account has been successfully activated!</h3>
<div class="uk-width-1-3@m uk-align-center">
<%--<p>Please click <a href="http://beta.services.openaire.eu/uoa-user-management/openid_connect_login">here</a> to login.</p>--%>
</div>
</ul>
</div>
</div>
<!-- END OF CENTER SIDE -->
</div>
</div>
</div>
</div>
</div>
<!-- CONTENT ENDS HERE -->
<!-- FOOTER STARTS HERE-->
<div class="custom-footer" style="z-index: 200;">
<div class="uk-section-primary uk-section uk-section-small">
<div class="uk-container">
<div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid="">
<div class="uk-width-1-1@m uk-first-column">
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-center">
<img alt="OpenAIRE" class="el-image" src="./images/Logo_Horizontal_white_small.png">
</div>
<div class="footer-license uk-margin uk-margin-remove-bottom uk-text-center uk-text-lead">
<div><a href="http://creativecommons.org/licenses/by/4.0/" target="_blank" rel="license"><img alt="Creative" src="./images/80x15.png" style="height: auto; max-width: 100%; vertical-align: middle;"></a>&nbsp;UNLESS OTHERWISE INDICATED, ALL MATERIALS CREATED BY THE OPENAIRE CONSORTIUM ARE LICENSED UNDER A&nbsp;<a href="http://creativecommons.org/licenses/by/4.0/" rel="license">CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE</a>.</div>
<div>OPENAIRE IS POWERED BY&nbsp;<a href="http://www.d-net.research-infrastructures.eu/">D-NET</a>.</div>
</div>
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-right">
<a class="uk-totop uk-icon" href="#" uk-scroll="" uk-totop="">
</a>
</div>
</div>
</div>
</div>
</div>
</div> <!-- FOOTER ENDS HERE -->
</div>
</body>
</html>
</html>

View File

@ -1,191 +0,0 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href=".">
<title>OpenAIRE - Registered services</title>
<script src="./js/jquery.js"></script>
<script src="./js/uikit.min.js"></script>
<script src="./js/validation.js"></script>
<script src="./js/uikit-icons-max.js"></script>
<link rel="stylesheet" style="text/css" href="./css/theme.css">
<link rel="stylesheet" style="text/css" href="./css/custom.css">
<link rel="stylesheet" style="text/css" href="./css/aai-custom.css">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="images/favicon//favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon"/>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
</head>
<body class="" style="" onload="success();">
<div class="uk-offcanvas-content uk-height-viewport">
<jsp:include page="header.jsp"/>
<!-- CONTENT STARTS HERE -->
<div class=" uk-section uk-margin-small-top uk-container uk-container-large" id="tm-main">
<div class="uk-grid ">
<div class="uk-width-1-4@m">
<div class="uk-card uk-card-default uk-card-body">
<div class="uk-h4">API Access</div>
<ul class="uk-nav uk-nav-default">
<li class=""><a href="./personalToken">Personal token</a></li>
<li class="uk-active"><a href="./registeredServices">Registered services</a></li>
</ul>
</div>
</div>
<!-- CENTER SIDE -->
<div class="uk-width-2-3@l uk-width-2-3@m">
<div class="uk-grid" uk-grid>
<div class="uk-width-expand@m">
<h4 class="uk-margin-remove-top uk-text-bold uk-text-primary">Registered services</h4>
<c:if test="${message != null}">
<div class="uk-text-danger uk-margin-small-bottom">${message}</div>
<c:remove var="message" scope="session"/>
</c:if>
</div>
<div class="uk-text-center uk-width-auto@m">
<c:choose>
<c:when test="${not reachedLimit}">
<a class="uk-button uk-button-primary" href="./registerService">
<span class="uk-icon" uk-icon="icon:plus-circle"></span>
<span class="uk-margin-small-left">New service</span>
</a>
</c:when>
<c:otherwise>
<button class="uk-button uk-button-default" disabled>
<span class="uk-icon" uk-icon="icon:plus-circle"></span>
<span class="uk-margin-small-left">New service</span>
</button>
</c:otherwise>
</c:choose>
<c:remove var="reachedLimit" scope="session"/>
</div>
</div>
<div class="uk-margin-top">
<div class="uk-alert-primary uk-alert uk-margin-top-remove uk-flex uk-flex-middle">
<span uk-icon="info"></span>
<span class="uk-margin-small-left">You can register up to 5 services.
For more information please read the <a href="https://graph.openaire.eu/develop/authentication.html" target="_blank">OpenAIRE API Authentication documentation</a>.</span>
</div>
<c:if test="${reachedLimit}">
<div class="uk-alert-warning uk-flex uk-flex-middle uk-margin-small-top">
<span uk-icon="warning"></span>
<span class="uk-margin-small-left">You have reached the maximum size of allowed registered services.</span>
</div>
</c:if>
<c:if test="${empty registeredServices && showEmptyList}">
<div class="uk-text-center">You have not registered any service yet!</div>
</c:if>
<c:if test="${registeredServices.size() > 0}">
<ul class="uk-list uk-list-divider">
<li>
<div class="uk-grid uk-child-width-1-4 uk-text-muted" uk-grid>
<div>Name</div>
<div>Client Id</div>
<div>Creation Date</div>
<div>Actions</div>
</div>
</li>
<c:forEach items="${registeredServices}" var="registeredService" varStatus="loop">
<c:set var="key" value="${registeredService.id}"/>
<li>
<div class="uk-grid uk-child-width-1-4" uk-grid>
<div>
<a uk-toggle="target: #details${registeredService.id}; animation: uk-animation-fade">
<span>${registeredService.name}</span>
<span class="space" uk-icon="icon:info;ratio:0.7"></span>
</a>
</div>
<div>
<span>${registeredService.clientId}</span>
</div>
<div><fmt:formatDate value="${registeredService.date}"
pattern="dd-MM-yyyy HH:mm"/>
</div>
<div>
<a href="./registerService?id=${registeredService.id}" class="uk-margin-small-right">
<span uk-icon="pencil"></span>
</a>
<a class="uk-text-danger" uk-icon="trash" uk-toggle="target: #modal${registeredService.id}"></a>
<!-- This is the modal -->
<div id="modal${registeredService.id}" uk-modal>
<div class="uk-modal-dialog uk-modal-body">
<form name="delete${registeredService.id}"
id="delete${registeredService.id}" method="post">
<input type="hidden" name="id"
value="${registeredService.id}"/>
<h2 class="uk-margin-remove-top">Delete service</h2>
<div class="uk-margin-medium-bottom">
Are you sure you want to delete the
'${registeredService.name}' service? You cannot undo
this action!
</div>
<div class="uk-text-right">
<button class="uk-button uk-button-default uk-modal-close" type="button">Cancel
</button>
<button class="uk-button uk-button-danger uk-margin-small-left" type="button"
onclick="document.delete${registeredService.id}.submit();document.getElementById('modal${registeredService.id}').style.visibility='hidden';">
Delete
</button>
</div>
</form>
</div>
</div>
</div>
</div>
</li>
<li id="details${registeredService.id}" hidden="hidden">
<div class="uk-alert">
<p><span class="uk-text-primary">Name:</span> ${services[key].clientName}</p>
<p><span class="uk-text-primary">Client Id:</span> ${services[key].clientId}</p>
<p><span class="uk-text-primary">Scope:</span> openid</p>
<p><span class="uk-text-primary">Grant type:</span> client credentials</p>
<c:choose>
<c:when test="${registeredService.keyType == null}">
<p><span class="uk-text-primary">Client secret:</span> ${services[key].clientSecret}</p>
<p><span class="uk-text-primary">Authentication Method</span> Client Secret Basic</p>
</c:when>
<c:otherwise>
<p><span class="uk-text-primary">Authentication Method</span> Asymmetrically-signed JWT assertion</p>
<p><span class="uk-text-primary">Token Endpoint Authentication Signing Algorithm</span> RSASSA using
SHA-256 hash algorithm</p>
<p><span class="uk-text-primary">Public Key</span>
<pre><code>${keys[key]}</code></pre>
</p>
</c:otherwise>
</c:choose>
<p><span class="uk-text-primary">Creation Date:</span>
<jsp:useBean id="date" class="java.util.Date"/>
<jsp:setProperty name="date" property="time" value="${services[key].clientIdIssuedAt*1000}"/>
<fmt:formatDate value="${date}"
pattern="dd-MM-yyyy HH:mm"/>
</p>
</div>
</li>
</c:forEach>
</ul>
</c:if>
</div>
<!-- END OF CENTER SIDE -->
</div>
</div>
</div>
<!-- CONTENT ENDS HERE -->
<c:import url="footer.jsp"/>
</body>
</html>
<script>
function success() {
if('${success}' !=='')
UIkit.modal.alert('${success}');
}
</script>
<c:remove var="success" scope="session"/>

View File

@ -1,120 +1,52 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href=".">
<title>OpenAIRE - Username Reminder</title>
<script src="./js/jquery.js"></script>
<script src="./js/uikit.min.js"></script>
<link rel="stylesheet" style="text/css" href="./css/theme.css">
<link rel="stylesheet" style="text/css" href="./css/custom.css">
<link rel="stylesheet" style="text/css" href="./css/aai-custom.css">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="images/favicon//favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
<script src='https://www.google.com/recaptcha/api.js'></script>
</head>
<body class="" style="">
<div class="uk-offcanvas-content uk-height-viewport">
<!-- MENU STARTS HERE -->
<!-- MAIN MENU STARTS HERE -->
<div class="tm-header tm-header-transparent" uk-header="">
<div class="uk-container uk-container-expand">
<nav class="uk-navbar" uk-navbar="{&quot;align&quot;:&quot;left&quot;}">
<div class="uk-navbar-center">
<div class="uk-logo uk-navbar-item">
<img alt="OpenAIRE" class="uk-responsive-height" src="./images/Logo_Horizontal.png">
</div>
</div>
</nav>
</div>
<jsp:include page="head.jsp">
<jsp:param name="title" value="OpenAIRE - Username Reminder"/>
<jsp:param name="form" value="true"/>
</jsp:include>
<body>
<div class="uk-section uk-section-small uk-container uk-container-small">
<div class="uk-text-center">
<img src="images/Logo_Horizontal.png" style="height: 80px;">
<h1 class="uk-h4 uk-margin-large-top">Forgot username</h1>
<div class="uk-margin-large-bottom uk-margin-medium-top">
Please enter the <span class="uk-text-bolder">email address</span> of your account. Your username will be
sent to you as a file.
</div>
<!-- MENU ENDS HERE -->
<!-- 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" uk-grid="">
</div>
</div>
<div class=" uk-section tm-middle custom-main-content" id="tm-main">
<div class="uk-container uk-container-small uk-margin-small-bottom uk-text-center">
<h2 class="uk-h2 uk-margin-small-bottom">Forgot username</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 ">
<!-- CENTER SIDE -->
<div class="uk-width-1-1@m uk-width-1-1@s uk-text-center">
<!-- <h3 class="uk-h3">Forgot usernmame</h3> -->
<div class="middle-box text-left loginscreen animated fadeInDown ">
<p>Please enter the email address associated with your User account. Your username will be emailed to the email address on file.</p>
<div class="uk-width-1-3@m uk-align-center">
<!-- REGISTER FORM -->
<div id="registerForm">
<form action="remindUsername" method="POST" role="form" class="m-t" id="register_form">
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div class="alert alert-success" aria-hidden="true" style="display: none;"></div>
<div class="alert alert-danger" aria-hidden="true" style="display: none;"></div>
<div class="form-group">
<span id="server_error" class="uk-text-danger uk-text-small uk-float-left">${message}</span>
<c:remove var="message" scope="session" />
<span class="msg_email_error uk-text-danger uk-text-small uk-float-left" style="display:none">Please enter your email.</span>
<span class="msg_email_validation_error uk-text-danger uk-text-small uk-float-left" style="display:none">Please enter a valid email.</span>
<input id="email" name="email" type="text" placeholder="Email" class="form-control"></div>
<div class="uk-margin uk-grid-small uk-child-width-auto uk-grid uk-text-left uk-grid-stack" uk-grid="">
<div class="uk-width-1-1 uk-grid-margin uk-first-column">
<div class="g-recaptcha" data-sitekey=${applicationScope.sitekey}></div>
</div>
<div class="uk-width-1-1 uk-grid-margin uk-first-column">
<button type="submit" class="uk-button uk-button-primary" onclick="return validateForm();">Submit</button>
</div>
</div>
</form>
</div>
<script>
$("#email").focusin(function() {
$(this).removeClass('aai-form-danger');
$("#server_error").fadeOut();
$(".msg_email_error").fadeOut();
$(".msg_email_validation_error").fadeOut();
});
</script>
<!-- END OF REGISTER FORM -->
</div>
</ul>
</div>
</div>
<!-- END OF CENTER SIDE -->
</div>
</div>
</div>
</div>
</div>
<!-- CONTENT ENDS HERE -->
<!-- FOOTER STARTS HERE-->
<div class="custom-footer" style="z-index: 200;">
<div class="uk-section-primary uk-section uk-section-small">
<div class="uk-container">
<div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid="">
<div class="uk-width-1-1@m uk-first-column">
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-center">
<img alt="OpenAIRE" class="el-image" src="./images/Logo_Horizontal_white_small.png">
</div>
<div class="footer-license uk-margin uk-margin-remove-bottom uk-text-center uk-text-lead">
<div><a href="http://creativecommons.org/licenses/by/4.0/" target="_blank" rel="license"><img alt="Creative" src="./images/80x15.png" style="height: auto; max-width: 100%; vertical-align: middle;"></a>&nbsp;UNLESS OTHERWISE INDICATED, ALL MATERIALS CREATED BY THE OPENAIRE CONSORTIUM ARE LICENSED UNDER A&nbsp;<a href="http://creativecommons.org/licenses/by/4.0/" rel="license">CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE</a>.</div>
<div>OPENAIRE IS POWERED BY&nbsp;<a href="http://www.d-net.research-infrastructures.eu/">D-NET</a>.</div>
</div>
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-right">
<a class="uk-totop uk-icon" href="#" uk-scroll="" uk-totop="">
</a>
</div>
</div>
</div>
</div>
</div>
</div> <!-- FOOTER ENDS HERE -->
</div>
<form action="remindUsername" method="POST" role="form"
class="uk-grid uk-child-width-1-1 uk-flex-column uk-flex-middle" uk-grid>
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div input id="email" class="uk-width-medium@s">
<div class="input-wrapper inner x-small">
<div class="input-box">
<div class="placeholder">
<label>Email <sup>*</sup></label>
</div>
<div class="uk-flex uk-flex-middle">
<input name="email" class="input uk-text-truncate">
</div>
</div>
</div>
</div>
<div class="uk-width-1-1 uk-flex uk-flex-center">
<div class="g-recaptcha" data-sitekey=${applicationScope.sitekey}></div>
</div>
<div class="uk-width-1-1 uk-text-center">
<div id="server_error" class="uk-text-danger uk-text-center uk-text-small uk-margin-bottom">${message}</div>
<c:remove var="message" scope="session" />
<button type="submit" class="uk-button uk-button-primary" onclick="return validateForm();">
Submit
</button>
</div>
</form>
</div>
</body>
<script>
$("#email input").focusin(function () {
$("#server_error").hide();
});
</script>
</html>

View File

@ -1,126 +1,61 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
Created by IntelliJ IDEA.
User: sofia
Date: 14/5/2018
Time: 5:37 μμ
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href=".">
<script src="./js/jquery.js"></script>
<script src="./js/uikit.min.js"></script>
<link rel="stylesheet" style="text/css" href="./css/theme.css">
<link rel="stylesheet" style="text/css" href="./css/custom.css">
<link rel="stylesheet" style="text/css" href="./css/aai-custom.css">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="images/favicon//favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
<script src='https://www.google.com/recaptcha/api.js'></script>
<title>OpenAIRE - Request an Activation Code</title>
</head>
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
<jsp:include page="head.jsp">
<jsp:param name="title" value="OpenAIRE - Request an Activation Code"/>
<jsp:param name="form" value="true"/>
</jsp:include>
<body>
<div class="uk-offcanvas-content uk-height-viewport">
<!-- MENU STARTS HERE -->
<!-- MAIN MENU STARTS HERE -->
<div class="tm-header tm-header-transparent" uk-header="">
<div class="uk-container uk-container-expand">
<nav class="uk-navbar" uk-navbar="{&quot;align&quot;:&quot;left&quot;}">
<div class="uk-navbar-center">
<div class="uk-logo uk-navbar-item">
<img alt="OpenAIRE" class="uk-responsive-height" src="./images/Logo_Horizontal.png">
</div>
</div>
</nav>
</div>
<div class="uk-section uk-section-small uk-container uk-container-small">
<div class="uk-text-center">
<img src="images/Logo_Horizontal.png" style="height: 80px;">
<h1 class="uk-h4 uk-margin-large-top">Request an activation code</h1>
<div class="uk-margin-large-bottom uk-margin-medium-top">
Please enter the <span class="uk-text-bolder">username</span> of your account. A new activation code will be
sent to you. Once you have received the activation code, you will be able to activate your account.
</div>
<!-- MENU ENDS HERE -->
<!-- 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" uk-grid="">
</div>
</div>
<div class=" uk-section tm-middle custom-main-content" id="tm-main">
<div class="uk-container uk-container-small uk-margin-small-bottom uk-text-center">
<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 ">
<!-- CENTER SIDE -->
<div class="uk-width-1-1@m uk-width-1-1@s uk-text-center">
<div class="middle-box text-center loginscreen animated fadeInDown ">
<p>Please enter your username. We will send you an email with a new activation code to activate your account.</p>
<div class="uk-width-1-3@m uk-align-center">
<!-- REQUEST AN ACTIVATION CODE FORM -->
<div id="registerForm">
<form action="requestActivationCode" method="POST" role="form" class="m-t" id="register_form">
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div class="alert alert-success" aria-hidden="true" style="display: none;"></div>
<div class="alert alert-danger" aria-hidden="true" style="display: none;"></div>
<div class="form-group">
<span id="server_error" class="uk-text-danger uk-text-small uk-float-left">${message}</span>
<c:remove var="message" scope="session" />
<span class="msg_username_error uk-text-danger uk-text-small uk-float-left" style="display:none">Please enter your username.</span>
<input id="username" name="username" type="text" placeholder="Username" class="form-control"></div>
<div class="uk-margin uk-grid-small uk-child-width-auto uk-grid uk-text-left uk-grid-stack" uk-grid="">
<span id="server_error" class="uk-text-danger uk-text-small uk-float-left">${reCAPTCHA_message}</span>
<c:remove var="reCAPTCHA_message" scope="session" />
<div class="uk-width-1-1 uk-grid-margin uk-first-column">
<div class="g-recaptcha" data-sitekey=${applicationScope.sitekey}></div>
</div>
<div class="uk-width-1-1 uk-grid-margin uk-first-column">
<button type="submit" class="uk-button uk-button-primary" onclick="return validateForm();">Submit</button>
</div>
</div>
</form>
</div>
<script>
$("#username").focusin(function() {
$(this).removeClass('aai-form-danger');
$("#server_error").fadeOut();
$(".msg_username_error").fadeOut();
});
</script>
<!-- END OF REQUEST AN ACTIVATION CODE FORM -->
</div>
</ul>
</div>
</div>
<!-- END OF CENTER SIDE -->
</div>
</div>
</div>
</div>
</div>
<!-- CONTENT ENDS HERE -->
<!-- FOOTER STARTS HERE-->
<div class="custom-footer" style="z-index: 200;">
<div class="uk-section-primary uk-section uk-section-small">
<div class="uk-container">
<div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid="">
<div class="uk-width-1-1@m uk-first-column">
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-center">
<img alt="OpenAIRE" class="el-image" src="./images/Logo_Horizontal_white_small.png">
</div>
<div class="footer-license uk-margin uk-margin-remove-bottom uk-text-center uk-text-lead">
<div><a href="http://creativecommons.org/licenses/by/4.0/" target="_blank" rel="license"><img alt="Creative" src="./images/80x15.png" style="height: auto; max-width: 100%; vertical-align: middle;"></a>&nbsp;UNLESS OTHERWISE INDICATED, ALL MATERIALS CREATED BY THE OPENAIRE CONSORTIUM ARE LICENSED UNDER A&nbsp;<a href="http://creativecommons.org/licenses/by/4.0/" rel="license">CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE</a>.</div>
<div>OPENAIRE IS POWERED BY&nbsp;<a href="http://www.d-net.research-infrastructures.eu/">D-NET</a>.</div>
</div>
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-right">
<a class="uk-totop uk-icon" href="#" uk-scroll="" uk-totop="">
</a>
</div>
</div>
</div>
</div>
</div>
</div> <!-- FOOTER ENDS HERE -->
</div>
<form action="requestActivationCode" method="POST" role="form"
class="uk-grid uk-child-width-1-1 uk-flex-column uk-flex-middle" uk-grid>
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div input id="username" class="uk-width-medium@s">
<div class="input-wrapper inner x-small">
<div class="input-box">
<div class="placeholder">
<label>Username <sup>*</sup></label>
</div>
<div class="uk-flex uk-flex-middle">
<input name="username" class="input uk-text-truncate">
</div>
</div>
</div>
<span id="msg_username_error" class="uk-text-danger uk-text-small">
${message}
</span>
<c:remove var="message" scope="session"/>
</div>
<div class="uk-width-1-1 uk-text-center">
<div class="uk-flex uk-flex-center">
<div class="g-recaptcha" data-sitekey=${applicationScope.sitekey}></div>
</div>
<div id="server_error" class="uk-text-danger uk-text-small">
${reCAPTCHA_message}
</div>
<c:remove var="reCAPTCHA_message" scope="session"/>
</div>
<div class="uk-width-1-1 uk-text-center">
<button type="submit" class="uk-button uk-button-primary" onclick="return validateForm();">
Submit
</button>
</div>
</form>
</div>
</body>
<script>
$("#username input").focusin(function () {
$("#msg_username_error").hide();
$("#server_error").hide();
});
</script>
</html>

View File

@ -1,127 +1,62 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
Created by IntelliJ IDEA.
User: sofia
Date: 21/5/2018
Time: 1:21 μμ
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href=".">
<script src="./js/jquery.js"></script>
<script src="./js/uikit.min.js"></script>
<link rel="stylesheet" style="text/css" href="./css/theme.css">
<link rel="stylesheet" style="text/css" href="./css/custom.css">
<link rel="stylesheet" style="text/css" href="./css/aai-custom.css">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="images/favicon//favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
<script src='https://www.google.com/recaptcha/api.js'></script>
<title>OpenAIRE - Request to Delete Account</title>
</head>
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
<jsp:include page="head.jsp">
<jsp:param name="title" value="OpenAIRE - Request to Delete Account"/>
<jsp:param name="form" value="true"/>
</jsp:include>
<body>
<div class="uk-offcanvas-content uk-height-viewport">
<!-- MENU STARTS HERE -->
<!-- MAIN MENU STARTS HERE -->
<div class="tm-header tm-header-transparent" uk-header="">
<div class="uk-container uk-container-expand">
<nav class="uk-navbar" uk-navbar="{&quot;align&quot;:&quot;left&quot;}">
<div class="uk-navbar-center">
<div class="uk-logo uk-navbar-item">
<img alt="OpenAIRE" class="uk-responsive-height" src="./images/Logo_Horizontal.png">
</div>
</div>
</nav>
</div>
<div class="uk-section uk-section-small uk-container uk-container-small">
<div class="uk-text-center">
<img src="images/Logo_Horizontal.png" style="height: 80px;">
<h1 class="uk-h4 uk-margin-large-top">Request to delete your account</h1>
<div class="uk-margin-large-bottom uk-margin-medium-top">
Please enter the <span class="uk-text-bolder">email address</span> of your account. A verification code will be
sent to you. Once you have received
the verification code, you will be able to delete your account.
</div>
<!-- MENU ENDS HERE -->
<!-- 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" uk-grid="">
</div>
<form action="requestToDeleteAccount" method="POST" role="form"
class="uk-grid uk-child-width-1-1 uk-flex-column uk-flex-middle" uk-grid>
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div input id="email" class="uk-width-medium@s">
<div class="input-wrapper inner x-small">
<div class="input-box">
<div class="placeholder">
<label>Email <sup>*</sup></label>
</div>
<div class="uk-flex uk-flex-middle">
<input name="email" class="input uk-text-truncate">
</div>
</div>
</div>
<span id="msg_email_error" class="uk-text-danger uk-text-small">
${message}
</span>
<c:remove var="message" scope="session"/>
</div>
<div class=" uk-section tm-middle custom-main-content" id="tm-main">
<div class="uk-container uk-container-small uk-margin-small-bottom uk-text-center">
<h2 class="uk-h2 uk-margin-small-bottom">Request to delete your account</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 ">
<!-- CENTER SIDE -->
<div class="uk-width-1-1@m uk-width-1-1@s uk-text-center">
<div class="middle-box text-center loginscreen animated fadeInDown ">
<p>Please enter your email. We will send you an email with a verification code to delete your account.</p>
<div class="uk-width-1-3@m uk-align-center">
<!-- REQUEST A VERIFICATION CODE FORM -->
<div id="registerForm">
<form action="requestToDeleteAccount" method="POST" role="form" class="m-t" id="register_form">
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div class="alert alert-success" aria-hidden="true" style="display: none;"></div>
<div class="alert alert-danger" aria-hidden="true" style="display: none;"></div>
<div class="form-group">
<span id="server_error" class="uk-text-danger uk-text-small uk-float-left">${message}</span>
<c:remove var="message" scope="session" />
<span class="msg_email_error uk-text-danger uk-text-small uk-float-left" style="display:none">Please enter your email.</span>
<input id="email" name="email" type="text" placeholder="Email" class="form-control"></div>
<div class="uk-margin uk-grid-small uk-child-width-auto uk-grid uk-text-left uk-grid-stack" uk-grid="">
<span id="server_error" class="uk-text-danger uk-text-small uk-float-left">${reCAPTCHA_message}</span>
<c:remove var="reCAPTCHA_message" scope="session" />
<div class="uk-width-1-1 uk-grid-margin uk-first-column">
<div class="g-recaptcha" data-sitekey=${applicationScope.sitekey}></div>
</div>
<div class="uk-width-1-1 uk-grid-margin uk-first-column">
<button type="submit" class="uk-button uk-button-primary" onclick="return validateForm();">Submit</button>
</div>
</div>
</form>
</div>
<script>
$("#email").focusin(function() {
$(this).removeClass('aai-form-danger');
$("#server_error").fadeOut();
$(".msg_email_error").fadeOut();
});
</script>
<!-- END OF REQUEST A VERIFICATION CODE FORM -->
</div>
</ul>
</div>
</div>
<!-- END OF CENTER SIDE -->
</div>
</div>
</div>
</div>
<div class="uk-width-1-1 uk-text-center">
<div class="uk-flex uk-flex-center">
<div class="g-recaptcha" data-sitekey=${applicationScope.sitekey}></div>
</div>
<div id="server_error" class="uk-text-danger uk-text-small">
${reCAPTCHA_message}
</div>
<c:remove var="reCAPTCHA_message" scope="session"/>
</div>
<!-- CONTENT ENDS HERE -->
<!-- FOOTER STARTS HERE-->
<div class="custom-footer" style="z-index: 200;">
<div class="uk-section-primary uk-section uk-section-small">
<div class="uk-container">
<div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid="">
<div class="uk-width-1-1@m uk-first-column">
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-center">
<img alt="OpenAIRE" class="el-image" src="./images/Logo_Horizontal_white_small.png">
</div>
<div class="footer-license uk-margin uk-margin-remove-bottom uk-text-center uk-text-lead">
<div><a href="http://creativecommons.org/licenses/by/4.0/" target="_blank" rel="license"><img alt="Creative" src="./images/80x15.png" style="height: auto; max-width: 100%; vertical-align: middle;"></a>&nbsp;UNLESS OTHERWISE INDICATED, ALL MATERIALS CREATED BY THE OPENAIRE CONSORTIUM ARE LICENSED UNDER A&nbsp;<a href="http://creativecommons.org/licenses/by/4.0/" rel="license">CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE</a>.</div>
<div>OPENAIRE IS POWERED BY&nbsp;<a href="http://www.d-net.research-infrastructures.eu/">D-NET</a>.</div>
</div>
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-right">
<a class="uk-totop uk-icon" href="#" uk-scroll="" uk-totop="">
</a>
</div>
</div>
</div>
</div>
</div>
</div> <!-- FOOTER ENDS HERE -->
<div class="uk-width-1-1 uk-text-center">
<button type="submit" class="uk-button uk-button-primary" onclick="return validateForm();">
Submit
</button>
</div>
</form>
</div>
</body>
<script>
$("#email input").focusin(function () {
$("#msg_email_error").hide();
$("#server_error").hide();
});
</script>
</html>

View File

@ -1,200 +1,99 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<% if (session.getAttribute("username") == null) {
String redirectURL = request.getContextPath() + "/forgotPassword.jsp";
response.sendRedirect(redirectURL);
}
%>
<%--<%String name=(String)request.getAttribute("name");--%>
<%--out.print("your name"+name);%>--%>
}%>
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href=".">
<title>OpenAIRE - Reset Password</title>
<script src="./js/jquery.js"></script>
<script src="./js/uikit.min.js"></script>
<script src="./js/validation.js"></script>
<link rel="stylesheet" style="text/css" href="./css/theme.css">
<link rel="stylesheet" style="text/css" href="./css/custom.css">
<link rel="stylesheet" style="text/css" href="./css/aai-custom.css">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="images/favicon//favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
</head>
<body class="" style="">
<div class="uk-offcanvas-content uk-height-viewport">
<!-- MENU STARTS HERE -->
<!-- MAIN MENU STARTS HERE -->
<div class="tm-header tm-header-transparent" uk-header="">
<div class="uk-container uk-container-expand">
<nav class="uk-navbar" uk-navbar="{&quot;align&quot;:&quot;left&quot;}">
<div class="uk-navbar-center">
<div class="uk-logo uk-navbar-item">
<img alt="OpenAIRE" class="uk-responsive-height" src="./images/Logo_Horizontal.png">
</div>
</div>
</nav>
</div>
<jsp:include page="head.jsp">
<jsp:param name="title" value="OpenAIRE - Reset password"/>
<jsp:param name="form" value="true"/>
</jsp:include>
<body>
<div class="uk-section uk-section-small uk-container uk-container-small">
<div class="uk-text-center">
<img src="images/Logo_Horizontal.png" style="height: 80px;">
<h1 class="uk-h4 uk-margin-large-top">Reset password</h1>
<div class="uk-margin-large-bottom uk-margin-medium-top">
To complete the password reset process, please enter a new password.
</div>
<!-- MENU ENDS HERE -->
<!-- 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" uk-grid="">
</div>
</div>
<div class=" uk-section tm-middle custom-main-content" id="tm-main">
<div class="uk-container uk-container-small uk-margin-small-bottom uk-text-center">
<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 ">
<!-- CENTER SIDE -->
<div class="uk-width-1-1@m uk-width-1-1@s uk-text-center">
<div class="middle-box text-center loginscreen animated fadeInDown ">
<p>To complete the password reset process, please enter a new password. <b>Must contain at least one number and one uppercase and lowercase letter, and at least 6 or more characters.
No white space allowed.</b></p>
<div class="uk-width-1-3@m uk-align-center"></p>
<!-- REGISTER FORM -->
<div id="registerForm">
<form action="resetPassword" method="POST" role="form" class="m-t" id="register_form" >
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div class="alert alert-success" aria-hidden="true" style="display: none;"></div>
<div class="alert alert-danger" aria-hidden="true" style="display: none;"></div>
<div class="form-group">
<span class="msg_password_error uk-text-danger uk-text-small uk-float-left" style="display:none">Please enter your password.</span>
<span class="msg_pass_conf_error uk-text-danger uk-text-small uk-float-left" style="display:none">These passwords don't match.</span>
<p><span class="msg_please_add uk-text-danger uk-text-small uk-float-left" style="display:none">Please add: &nbsp</span></p>
<span class="msg_lowercase_letter uk-text-danger uk-text-small uk-float-left" style="display:none">A lowercase letter. &nbsp</span>
<span class="msg_capital_letter uk-text-danger uk-text-small uk-float-left" style="display:none">A capital (uppercase) letter. &nbsp </span>
<span class="msg_number uk-text-danger uk-text-small uk-float-left" style="display:none">A number. &nbsp</span>
<span class="msg_lenght uk-text-danger uk-text-small uk-float-left" style="display:none">Minimum 6 characters. &nbsp</span>
<p><span class="msg_space uk-text-danger uk-text-small uk-float-left" style="display:none">No white space allowed. &nbsp</span></p>
<%--<span id="server_invalid_password_error" class="uk-text-danger uk-text-small uk-float-left">${msg_invalid_password}</span>--%>
<%--<c:remove var="msg_invalid_password" scope="session" />--%>
<input id="password" name="password" type="password" placeholder="Password" class="form-control"></div>
<div class="form-group">
<input id="password_conf" name="password_conf" type="password" placeholder="Confirm password" class="form-control"></div>
<div class="uk-margin uk-grid-small uk-child-width-auto uk-grid uk-text-left uk-grid-stack" uk-grid="">
<div class="uk-width-1-1 uk-grid-margin uk-first-column">
<button type="submit" class="uk-button uk-button-primary" onclick="return validatePasswordForm();">Reset Password</button>
</div>
</div>
</form>
</div>
<!-- END OF REGISTER FORM -->
<script>
var password = document.getElementById("password");
// When the user starts to type something inside the password field
password.onkeyup = function() {
// Validate lowercase letters
var lowerCaseLetters = /[a-z]/g;
if (password.value.match(lowerCaseLetters)) {
$(".msg_lowercase_letter").fadeOut();
} else {
$(".msg_lowercase_letter").fadeIn();
}
// Validate capital letters
var upperCaseLetters = /[A-Z]/g;
if (password.value.match(upperCaseLetters)) {
$(".msg_capital_letter").fadeOut();
} else {
$(".msg_capital_letter").fadeIn();
}
// Validate numbers
var numbers = /[0-9]/g;
if (password.value.match(numbers)) {
$(".msg_number").fadeOut();
} else {
$(".msg_number").fadeIn();
}
// Validate length
if (password.value.length >= 6) {
$(".msg_lenght").fadeOut();
} else {
$(".msg_lenght").fadeIn();
}
// Validate no white space
var space = /[\s]+/g;
if (password.value.match(space)){
$(".msg_space").fadeIn();
} else {
$(".msg_space").fadeOut();
}
if(password.value.match(lowerCaseLetters) && password.value.match(upperCaseLetters)
&& password.value.match(numbers) && (password.value.length >= 6)){
if($(".msg_please_add").css('display')!='none'){
$(".msg_please_add").fadeOut();
}
} else {
if($(".msg_please_add").css('display')=='none') {
$(".msg_please_add").fadeIn();
}
}
}
$("#password").focusin(function () {
$(this).removeClass('aai-form-danger');
$(".msg_please_add").fadeOut();
$(".msg_password_error").fadeOut();
// $("#server_invalid_password_error").fadeOut();
$(".msg_pass_conf_error").fadeOut();
$(".msg_lowercase_letter").fadeOut();
$(".msg_capital_letter").fadeOut();
$(".msg_number").fadeOut();
$(".msg_lenght").fadeOut();
});
$("#password_conf").focusin(function () {
$(this).removeClass('aai-form-danger');
$(".msg_pass_conf_error").fadeOut();
});
</script>
</div>
</ul>
</div>
</div>
<!-- END OF CENTER SIDE -->
</div>
</div>
</div>
</div>
</div>
<!-- CONTENT ENDS HERE -->
<!-- FOOTER STARTS HERE-->
<div class="custom-footer" style="z-index: 200;">
<div class="uk-section-primary uk-section uk-section-small">
<div class="uk-container">
<div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid="">
<div class="uk-width-1-1@m uk-first-column">
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-center">
<img alt="OpenAIRE" class="el-image" src="./images/Logo_Horizontal_white_small.png">
</div>
<div class="footer-license uk-margin uk-margin-remove-bottom uk-text-center uk-text-lead">
<div><a href="http://creativecommons.org/licenses/by/4.0/" target="_blank" rel="license"><img alt="Creative" src="./images/80x15.png" style="height: auto; max-width: 100%; vertical-align: middle;"></a>&nbsp;UNLESS OTHERWISE INDICATED, ALL MATERIALS CREATED BY THE OPENAIRE CONSORTIUM ARE LICENSED UNDER A&nbsp;<a href="http://creativecommons.org/licenses/by/4.0/" rel="license">CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE</a>.</div>
<div>OPENAIRE IS POWERED BY&nbsp;<a href="http://www.d-net.research-infrastructures.eu/">D-NET</a>.</div>
</div>
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-right">
<a class="uk-totop uk-icon" href="#" uk-scroll="" uk-totop="">
</a>
</div>
</div>
</div>
</div>
</div>
</div> <!-- FOOTER ENDS HERE -->
</div>
<form action="resetPassword" method="POST" role="form"
class="uk-grid uk-child-width-1-1 uk-flex-column uk-flex-middle" uk-grid>
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div input id="password" class="uk-width-medium@s">
<div class="input-wrapper inner x-small">
<div class="input-box">
<div class="placeholder">
<label>Password <sup>*</sup></label>
</div>
<div class="uk-flex uk-flex-middle">
<input name="password" type="password" class="input uk-text-truncate">
</div>
</div>
</div>
<div id="msg_pass_error" class="uk-text-danger uk-text-small" style="display: none;">Please enter your password.</div>
<div id="msg_pass_conf_error" class="uk-text-danger uk-text-small" style="display: none;">The passwords don't match.</div>
<div id="msg_whitespace" class="uk-text-danger uk-text-small" style="display: none;">No white space allowed.</div>
<div id="msg_lowercase_letter" class="uk-text-danger uk-text-small" style="display: none;">Please add a lowercase letter.</div>
<div id="msg_uppercase_letter" class="uk-text-danger uk-text-small" style="display: none;">Please add an uppercase letter.</div>
<div id="msg_number" class="uk-text-danger uk-text-small" style="display: none;">Please add a number.</div>
<div id="msg_length" class="uk-text-danger uk-text-small" style="display: none;">Must contains at least 6 characters.</div>
<div id="msg_invalid_password" class="uk-text-danger uk-text-small" style="display: none;">
The password must contain a lowercase letter, a capital (uppercase) letter, a number and must be at least 6 characters long. White space character is not allowed.
</div>
<c:remove var="msg_pass_conf_error_display" scope="session" />
<c:remove var="msg_password_error_display" scope="session" />
<c:remove var="msg_invalid_password_display" scope="session" />
</div>
<div input id="password_conf" class="uk-width-medium@s">
<div class="input-wrapper inner x-small">
<div class="input-box">
<div class="placeholder">
<label>Confirm Password <sup>*</sup></label>
</div>
<div class="uk-flex uk-flex-middle">
<input name="password_conf" type="password" class="input uk-text-truncate">
</div>
</div>
</div>
</div>
<div class="uk-width-1-1 uk-flex uk-flex-center">
<div class="g-recaptcha" data-sitekey=${applicationScope.sitekey}></div>
</div>
<div class="uk-width-1-1 uk-text-center">
<div id="server_error" class="uk-text-danger uk-text-center uk-text-small uk-margin-bottom">${message}</div>
<c:remove var="message" scope="session" />
<button type="submit" class="uk-button uk-button-primary" onclick="return validatePasswordForm();">
Submit
</button>
</div>
</form>
</div>
</body>
<script>
$("input").focusin(function () {
$("#server_error").hide();
});
// On the fly check for password validation
let password = $("#password input")[0];
password.onkeyup = function () {
validatePassword(password.value);
};
$("#password input").focusin(function () {
$("#msg_password_error").hide();
$("#msg_pass_conf_error").hide();
$("#msg_lowercase_letter").hide();
$("#msg_capital_letter").hide();
$("#msg_number").hide();
$("#msg_length").hide();
});
$("#password_conf input").focusin(function () {
$("#msg_pass_conf_error").hide();
});
</script>
</html>

View File

@ -1,10 +1,3 @@
<%--
Created by IntelliJ IDEA.
User: sofia
Date: 19/10/2017
Time: 4:12 μμ
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
@ -16,94 +9,20 @@
session.removeAttribute("success");
}
%>
<%--<META HTTP-EQUIV=Refresh CONTENT="0.5; URL=http://beta.services.openaire.eu/uoa-user-management/openid_connect_login">--%>
<META HTTP-EQUIV=Refresh CONTENT='0.5; URL=<%= session.getAttribute("homeUrl")%>'>
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OpenAIRE - Success</title>
<script src="./js/jquery.js"></script>
<script src="./js/uikit.min.js"></script>
<script src="./js/validation.js"></script>
<link rel="stylesheet" style="text/css" href="./css/theme.css">
<link rel="stylesheet" style="text/css" href="./css/custom.css">
<link rel="stylesheet" style="text/css" href="./css/aai-custom.css">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="images/favicon//favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
</head>
<body class="" style="">
<div class="uk-offcanvas-content uk-height-viewport">
<!-- MENU STARTS HERE -->
<!-- MAIN MENU STARTS HERE -->
<div class="tm-header tm-header-transparent" uk-header="">
<div class="uk-container uk-container-expand">
<nav class="uk-navbar" uk-navbar="{&quot;align&quot;:&quot;left&quot;}">
<div class="uk-navbar-center">
<div class="uk-logo uk-navbar-item">
<img alt="OpenAIRE" class="uk-responsive-height" src="./images/Logo_Horizontal.png">
</div>
</div>
</nav>
<jsp:include page="head.jsp">
<jsp:param name="title" value="OpenAIRE - Success"/>
</jsp:include>
<body>
<div class="uk-section uk-section-small uk-container uk-container-small">
<div class="uk-text-center">
<img src="images/Logo_Horizontal.png" style="height: 80px;">
<div class="uk-margin-large-top uk-text-success">
<span class="material-icons" style="font-size: 180px;">check</span>
</div>
<div class="uk-text-large uk-text-bold uk-margin-medium-top">Your password has been successfully changed!</div>
</div>
<!-- MENU ENDS HERE -->
<!-- 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" uk-grid="">
</div>
</div>
<div class=" uk-section tm-middle custom-main-content" id="tm-main">
<div class="uk-container uk-container-small uk-margin-small-bottom uk-text-center">
<%--<h2 class="uk-h2 uk-margin-small-bottom">Forgot Password</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 ">
<!-- CENTER SIDE -->
<div class="uk-width-1-1@m uk-width-1-1@s uk-text-center">
<!-- <h3 class="uk-h3">Create an account</h3> -->
<div class="middle-box text-center loginscreen animated fadeInDown ">
<h3 class="uk-h4 uk-text-success">Your password has been successfully changed!</h3>
<div class="uk-width-1-3@m uk-align-center">
</div>
</ul>
</div>
</div>
<!-- END OF CENTER SIDE -->
</div>
</div>
</div>
</div>
</div>
<!-- CONTENT ENDS HERE -->
<!-- FOOTER STARTS HERE-->
<div class="custom-footer" style="z-index: 200;">
<div class="uk-section-primary uk-section uk-section-small">
<div class="uk-container">
<div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid="">
<div class="uk-width-1-1@m uk-first-column">
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-center">
<img alt="OpenAIRE" class="el-image" src="./images/Logo_Horizontal_white_small.png">
</div>
<div class="footer-license uk-margin uk-margin-remove-bottom uk-text-center uk-text-lead">
<div><a href="http://creativecommons.org/licenses/by/4.0/" target="_blank" rel="license"><img alt="Creative" src="./images/80x15.png" style="height: auto; max-width: 100%; vertical-align: middle;"></a>&nbsp;UNLESS OTHERWISE INDICATED, ALL MATERIALS CREATED BY THE OPENAIRE CONSORTIUM ARE LICENSED UNDER A&nbsp;<a href="http://creativecommons.org/licenses/by/4.0/" rel="license">CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE</a>.</div>
<div>OPENAIRE IS POWERED BY&nbsp;<a href="http://www.d-net.research-infrastructures.eu/">D-NET</a>.</div>
</div>
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-right">
<a class="uk-totop uk-icon" href="#" uk-scroll="" uk-totop="">
</a>
</div>
</div>
</div>
</div>
</div>
</div> <!-- FOOTER ENDS HERE -->
</div>
</body>
</html>

View File

@ -1,11 +1,3 @@
<%--
Created by IntelliJ IDEA.
User: sofia
Date: 23/10/2017
Time: 4:56 μμ
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
@ -16,92 +8,20 @@
} else if (session.getAttribute("successAddPassword") != null) {
session.removeAttribute("successAddPassword");
}%>
<%--<META HTTP-EQUIV=Refresh CONTENT="0.5; URL=http://beta.services.openaire.eu/uoa-user-management/openid_connect_login">--%>
<META HTTP-EQUIV=Refresh CONTENT='0.5; URL=<%= session.getAttribute("homeUrl")%>'>
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OpenAIRE - Success</title>
<script src="./js/jquery.js"></script>
<script src="./js/uikit.min.js"></script>
<script src="./js/validation.js"></script>
<link rel="stylesheet" style="text/css" href="./css/theme.css">
<link rel="stylesheet" style="text/css" href="./css/custom.css">
<link rel="stylesheet" style="text/css" href="./css/aai-custom.css">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="images/favicon//favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
</head>
<body class="" style="">
<div class="uk-offcanvas-content uk-height-viewport">
<!-- MENU STARTS HERE -->
<!-- MAIN MENU STARTS HERE -->
<div class="tm-header tm-header-transparent" uk-header="">
<div class="uk-container uk-container-expand">
<nav class="uk-navbar" uk-navbar="{&quot;align&quot;:&quot;left&quot;}">
<div class="uk-navbar-center">
<div class="uk-logo uk-navbar-item">
<img alt="OpenAIRE" class="uk-responsive-height" src="./images/Logo_Horizontal.png">
</div>
</div>
</nav>
<jsp:include page="head.jsp">
<jsp:param name="title" value="OpenAIRE - Success"/>
</jsp:include>
<body>
<div class="uk-section uk-section-small uk-container uk-container-small">
<div class="uk-text-center">
<img src="images/Logo_Horizontal.png" style="height: 80px;">
<div class="uk-margin-large-top uk-text-success">
<span class="material-icons" style="font-size: 180px;">check</span>
</div>
<div class="uk-text-large uk-text-bold uk-margin-medium-top">Your password has been successfully added!</div>
</div>
<!-- MENU ENDS HERE -->
<!-- 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" uk-grid="">
</div>
</div>
<div class=" uk-section tm-middle custom-main-content" id="tm-main">
<div class="uk-container uk-container-small uk-margin-small-bottom uk-text-center">
<%--<h2 class="uk-h2 uk-margin-small-bottom">Forgot Password</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 ">
<!-- CENTER SIDE -->
<div class="uk-width-1-1@m uk-width-1-1@s uk-text-center">
<!-- <h3 class="uk-h3">Create an account</h3> -->
<div class="middle-box text-center loginscreen animated fadeInDown ">
<h3 class="uk-h4 uk-text-success">Your password has been successfully added!</h3>
<div class="uk-width-1-3@m uk-align-center">
</div>
</ul>
</div>
</div>
<!-- END OF CENTER SIDE -->
</div>
</div>
</div>
</div>
</div>
<!-- CONTENT ENDS HERE -->
<!-- FOOTER STARTS HERE-->
<div class="custom-footer" style="z-index: 200;">
<div class="uk-section-primary uk-section uk-section-small">
<div class="uk-container">
<div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid="">
<div class="uk-width-1-1@m uk-first-column">
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-center">
<img alt="OpenAIRE" class="el-image" src="./images/Logo_Horizontal_white_small.png">
</div>
<div class="footer-license uk-margin uk-margin-remove-bottom uk-text-center uk-text-lead">
<div><a href="http://creativecommons.org/licenses/by/4.0/" target="_blank" rel="license"><img alt="Creative" src="./images/80x15.png" style="height: auto; max-width: 100%; vertical-align: middle;"></a>&nbsp;UNLESS OTHERWISE INDICATED, ALL MATERIALS CREATED BY THE OPENAIRE CONSORTIUM ARE LICENSED UNDER A&nbsp;<a href="http://creativecommons.org/licenses/by/4.0/" rel="license">CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE</a>.</div>
<div>OPENAIRE IS POWERED BY&nbsp;<a href="http://www.d-net.research-infrastructures.eu/">D-NET</a>.</div>
</div>
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-right">
<a class="uk-totop uk-icon" href="#" uk-scroll="" uk-totop="">
</a>
</div>
</div>
</div>
</div>
</div>
</div> <!-- FOOTER ENDS HERE -->
</div>
</body>
</html>
</html>

View File

@ -1,105 +1,27 @@
<%--
Created by IntelliJ IDEA.
User: sofia
Date: 21/5/2018
Time: 5:07 μμ
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<% if (session.getAttribute("successDeleteAccount") == null) {
String redirectURL = request.getContextPath() + "/error404.jsp";
response.sendRedirect(redirectURL);
} else if (session.getAttribute("successDeleteAccount")!=null) {
} else if (session.getAttribute("successDeleteAccount") != null) {
session.removeAttribute("successDeleteAccount");
}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="./js/jquery.js"></script>
<script src="./js/uikit.min.js"></script>
<script src="./js/validation.js"></script>
<link rel="stylesheet" style="text/css" href="./css/theme.css">
<link rel="stylesheet" style="text/css" href="./css/custom.css">
<link rel="stylesheet" style="text/css" href="./css/aai-custom.css">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="images/favicon//favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
<title>OpenAIRE - Success </title>
</head>
<body class="" style="">
<div class="uk-offcanvas-content uk-height-viewport">
<!-- MENU STARTS HERE -->
<!-- MAIN MENU STARTS HERE -->
<div class="tm-header tm-header-transparent" uk-header="">
<div class="uk-container uk-container-expand">
<nav class="uk-navbar" uk-navbar="{&quot;align&quot;:&quot;left&quot;}">
<div class="uk-navbar-center">
<div class="uk-logo uk-navbar-item">
<img alt="OpenAIRE" class="uk-responsive-height" src="./images/Logo_Horizontal.png">
</div>
</div>
</nav>
}%>
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
<jsp:include page="head.jsp">
<jsp:param name="title" value="OpenAIRE - Success"/>
</jsp:include>
<body>
<div class="uk-section uk-section-small uk-container uk-container-small">
<div class="uk-text-center">
<img src="images/Logo_Horizontal.png" style="height: 80px;">
<div class="uk-margin-large-top uk-text-success">
<span class="material-icons" style="font-size: 180px;">check</span>
</div>
<div class="uk-text-large uk-text-bold uk-margin-medium-top">Your account has been successfully deleted!</div>
<div class="uk-margin-top">We hope to see you again!</div>
</div>
<!-- MENU ENDS HERE -->
<!-- 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" uk-grid="">
</div>
</div>
<div class=" uk-section tm-middle custom-main-content" id="tm-main">
<div class="uk-container uk-container-small uk-margin-small-bottom uk-text-center">
<%--<h2 class="uk-h2 uk-margin-small-bottom">Forgot Password</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 ">
<!-- CENTER SIDE -->
<div class="uk-width-1-1@m uk-width-1-1@s uk-text-center">
<!-- <h3 class="uk-h3">Create an account</h3> -->
<div class="middle-box text-center loginscreen animated fadeInDown ">
<h3 class="uk-h4 uk-text-success">Your account has been successfully deleted!</h3>
<h3 class="uk-h4">We hope to see you again!</h3>
<div class="uk-width-1-3@m uk-align-center">
</div>
</ul>
</div>
</div>
<!-- END OF CENTER SIDE -->
</div>
</div>
</div>
</div>
</div>
<!-- CONTENT ENDS HERE -->
<!-- FOOTER STARTS HERE-->
<div class="custom-footer" style="z-index: 200;">
<div class="uk-section-primary uk-section uk-section-small">
<div class="uk-container">
<div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid="">
<div class="uk-width-1-1@m uk-first-column">
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-center">
<img alt="OpenAIRE" class="el-image" src="./images/Logo_Horizontal_white_small.png">
</div>
<div class="footer-license uk-margin uk-margin-remove-bottom uk-text-center uk-text-lead">
<div><a href="http://creativecommons.org/licenses/by/4.0/" target="_blank" rel="license"><img alt="Creative" src="./images/80x15.png" style="height: auto; max-width: 100%; vertical-align: middle;"></a>&nbsp;UNLESS OTHERWISE INDICATED, ALL MATERIALS CREATED BY THE OPENAIRE CONSORTIUM ARE LICENSED UNDER A&nbsp;<a href="http://creativecommons.org/licenses/by/4.0/" rel="license">CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE</a>.</div>
<div>OPENAIRE IS POWERED BY&nbsp;<a href="http://www.d-net.research-infrastructures.eu/">D-NET</a>.</div>
</div>
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-right">
<a class="uk-totop uk-icon" href="#" uk-scroll="" uk-totop="">
</a>
</div>
</div>
</div>
</div>
</div>
</div> <!-- FOOTER ENDS HERE -->
</div>
</body>
</html>

View File

@ -1,127 +1,74 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href=".">
<title>OpenAIRE - Account verification</title>
<script src="./js/jquery.js"></script>
<script src="./js/uikit.min.js"></script>
<script src="./js/validation.js"></script>
<link rel="stylesheet" style="text/css" href="./css/theme.css">
<link rel="stylesheet" style="text/css" href="./css/custom.css">
<link rel="stylesheet" style="text/css" href="./css/aai-custom.css">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="images/favicon//favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
</head>
<body class="" style="">
<div class="uk-offcanvas-content uk-height-viewport">
<!-- MENU STARTS HERE -->
<!-- MAIN MENU STARTS HERE -->
<div class="tm-header tm-header-transparent" uk-header="">
<div class="uk-container uk-container-expand">
<nav class="uk-navbar" uk-navbar="{&quot;align&quot;:&quot;left&quot;}">
<div class="uk-navbar-center">
<div class="uk-logo uk-navbar-item">
<img alt="OpenAIRE" class="uk-responsive-height" src="./images/Logo_Horizontal.png">
</div>
</div>
</nav>
</div>
<jsp:include page="head.jsp">
<jsp:param name="title" value="OpenAIRE - Account Verification"/>
<jsp:param name="form" value="true"/>
</jsp:include>
<body>
<div class="uk-section uk-section-small uk-container uk-container-small">
<div class="uk-text-center">
<img src="images/Logo_Horizontal.png" style="height: 80px;">
<h1 class="uk-h4 uk-margin-large-top">Account Verification</h1>
<div class="uk-margin-large-bottom uk-margin-medium-top">
An <span class="uk-text-bolder">email</span> has been sent to your email address. The email contains a verification code, please paste the verification code in the field below to prove that you are the owner of this account.
</div>
<!-- MENU ENDS HERE -->
<!-- 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" uk-grid="">
</div>
</div>
<div class=" uk-section tm-middle custom-main-content" id="tm-main">
<div class="uk-container uk-container-small uk-margin-small-bottom uk-text-center">
<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 ">
<!-- CENTER SIDE -->
<div class="uk-width-1-1@m uk-width-1-1@s uk-text-center">
<div class="middle-box text-center loginscreen animated fadeInDown ">
<p>An email has been sent to your email address. The email contains a verification code, please paste the verification code in the field below to prove that you are the owner of this account.</p>
<div class="uk-width-1-3@m uk-align-center">
<!-- Validate form -->
<div id="registerForm">
<form action="verifyCode" method="POST" role="form" class="m-t" id="register_form">
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div class="alert alert-success" aria-hidden="true" style="display: none;"></div>
<div class="alert alert-danger" aria-hidden="true" style="display: none;"></div>
<div class="form-group">
<span id="server_error" class="uk-text-danger uk-text-small uk-float-left">${message}</span>
<c:remove var="message" scope="session" />
<span id="server_username_error" class="uk-text-danger uk-text-small uk-float-left">${msg_username_error}</span>
<c:remove var="msg_username_error" scope="session" />
<input id="username" name="username" type="text" placeholder="Username" class="form-control">
</div>
<div class="form-group">
<span id="server_verification_code_error" class="uk-text-danger uk-text-small uk-float-left">${msg_verification_code_error}</span>
<c:remove var="msg_verification_code_error" scope="session" />
<input id="verification_code" name="verification_code" type="text" placeholder="Verification Code" value="${param.code}" class="form-control">
</div>
<div class="uk-margin uk-grid-small uk-child-width-auto uk-grid uk-text-left uk-grid-stack" uk-grid="">
<div class="uk-width-1-1 uk-grid-margin uk-first-column">
<button type="submit" class="uk-button uk-button-primary" onclick="return validateForm();">Submit</button>
</div>
</div>
</form>
</div>
<!-- END OF REGISTER FORM -->
<script>
$("#username").focusin(function() {
$(this).removeClass('aai-form-danger');
$("#server_username_error").fadeOut();
$("#server_error").fadeOut();
});
$("#verification_code").focusin(function() {
$(this).removeClass('aai-form-danger');
$("#server_verification_code_error").fadeOut();
$("#server_error").fadeOut();
});
</script>
</div>
</ul>
</div>
</div>
<!-- END OF CENTER SIDE -->
</div>
</div>
</div>
</div>
</div>
<!-- CONTENT ENDS HERE -->
<!-- FOOTER STARTS HERE-->
<div class="custom-footer" style="z-index: 200;">
<div class="uk-section-primary uk-section uk-section-small">
<div class="uk-container">
<div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid="">
<div class="uk-width-1-1@m uk-first-column">
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-center">
<img alt="OpenAIRE" class="el-image" src="./images/Logo_Horizontal_white_small.png">
</div>
<div class="footer-license uk-margin uk-margin-remove-bottom uk-text-center uk-text-lead">
<div><a href="http://creativecommons.org/licenses/by/4.0/" target="_blank" rel="license"><img alt="Creative" src="./images/80x15.png" style="height: auto; max-width: 100%; vertical-align: middle;"></a>&nbsp;UNLESS OTHERWISE INDICATED, ALL MATERIALS CREATED BY THE OPENAIRE CONSORTIUM ARE LICENSED UNDER A&nbsp;<a href="http://creativecommons.org/licenses/by/4.0/" rel="license">CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE</a>.</div>
<div>OPENAIRE IS POWERED BY&nbsp;<a href="http://www.d-net.research-infrastructures.eu/">D-NET</a>.</div>
</div>
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-right">
<a class="uk-totop uk-icon" href="#" uk-scroll="" uk-totop="">
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- FOOTER ENDS HERE -->
</div>
<form action="verifyCode" method="POST" role="form"
class="uk-grid uk-child-width-1-1 uk-flex-column uk-flex-middle" uk-grid>
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div id="server_error" class="uk-text-danger uk-text-center uk-text-small">${message}</div>
<c:remove var="message" scope="session" />
<div input id="username" class="uk-width-medium@s">
<div class="input-wrapper inner x-small">
<div class="input-box">
<div class="placeholder">
<label>Username <sup>*</sup></label>
</div>
<div class="uk-flex uk-flex-middle">
<input name="username" class="input uk-text-truncate">
</div>
</div>
</div>
<span id="server_username_error" class="uk-text-danger uk-text-small">
${msg_username_error}
</span>
<c:remove var="msg_username_error" scope="session" />
</div>
<div input id="verification_code" class="uk-width-medium@s">
<div class="input-wrapper inner x-small">
<div class="input-box">
<div class="placeholder">
<label>Verification Code <sup>*</sup></label>
</div>
<div class="uk-flex uk-flex-middle">
<input name="verification_code" value="${param.code}" class="input uk-text-truncate">
</div>
</div>
</div>
<span id="server_verification_code_error" class="uk-text-danger uk-text-small">
${msg_verification_code_error}
</span>
<c:remove var="msg_verification_code_error" scope="session" />
</div>
<div class="uk-width-1-1 uk-text-center">
<button type="submit" class="uk-button uk-button-primary" onclick="return validateForm();">
Submit
</button>
</div>
</form>
</div>
</body>
<script>
$("#username input").focusin(function() {
$("#server_username_error").hide();
$("#server_error").hide();
});
$("#verification_code input").focusin(function() {
$("#server_verification_code_error").hide();
$("#server_error").hide();
});
</script>
</html>

View File

@ -1,131 +1,73 @@
<%--
Created by IntelliJ IDEA.
User: sofia
Date: 20/10/2017
Time: 3:43 μμ
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href=".">
<title>OpenAIRE - Email Verification</title>
<script src="./js/jquery.js"></script>
<script src="./js/uikit.min.js"></script>
<script src="./js/validation.js"></script>
<link rel="stylesheet" style="text/css" href="./css/theme.css">
<link rel="stylesheet" style="text/css" href="./css/custom.css">
<link rel="stylesheet" style="text/css" href="./css/aai-custom.css">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="images/favicon//favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
</head>
<body class="" style="">
<div class="uk-offcanvas-content uk-height-viewport">
<!-- MENU STARTS HERE -->
<!-- MAIN MENU STARTS HERE -->
<div class="tm-header tm-header-transparent" uk-header="">
<div class="uk-container uk-container-expand">
<nav class="uk-navbar" uk-navbar="{&quot;align&quot;:&quot;left&quot;}">
<div class="uk-navbar-center">
<div class="uk-logo uk-navbar-item">
<img alt="OpenAIRE" class="uk-responsive-height" src="./images/Logo_Horizontal.png">
<jsp:include page="head.jsp">
<jsp:param name="title" value="OpenAIRE - Email Verification"/>
<jsp:param name="form" value="true"/>
</jsp:include>
<body>
<div class="uk-section uk-section-small uk-container uk-container-small">
<div class="uk-text-center">
<img src="images/Logo_Horizontal.png" style="height: 80px;">
<h1 class="uk-h4 uk-margin-large-top">Email Verification</h1>
<div class="uk-margin-large-bottom uk-margin-medium-top">
An <span class="uk-text-bolder">email</span> has been sent to your email address. The email contains a verification code, please paste the verification code in the field below to prove that you are the owner of this account.
</div>
</div>
<form action="verifyCode" method="POST" role="form"
class="uk-grid uk-child-width-1-1 uk-flex-column uk-flex-middle" uk-grid>
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div id="server_error" class="uk-text-danger uk-text-center uk-text-small">${message}</div>
<c:remove var="message" scope="session" />
<div input id="username" class="uk-width-medium@s">
<div class="input-wrapper inner x-small">
<div class="input-box">
<div class="placeholder">
<label>Username <sup>*</sup></label>
</div>
</div>
</nav>
</div>
</div>
<!-- MENU ENDS HERE -->
<!-- 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" uk-grid="">
</div>
</div>
<div class=" uk-section tm-middle custom-main-content" id="tm-main">
<div class="uk-container uk-container-small uk-margin-small-bottom uk-text-center">
<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 ">
<!-- CENTER SIDE -->
<div class="uk-width-1-1@m uk-width-1-1@s uk-text-center">
<div class="middle-box text-center loginscreen animated fadeInDown ">
<p>An email has been sent to your email address. The email contains your username and an activation code, please paste them in the fields below to prove that you are the owner of this email account.</p>
<div class="uk-width-1-3@m uk-align-center">
<!-- Validate form -->
<div id="registerForm">
<form action="verifyCode" method="POST" role="form" class="m-t" id="register_form">
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div class="alert alert-success" aria-hidden="true" style="display: none;"></div>
<div class="alert alert-danger" aria-hidden="true" style="display: none;"></div>
<div class="form-group">
<span id="server_error" class="uk-text-danger uk-text-small uk-float-left">${message}</span>
<c:remove var="message" scope="session" />
<span class="msg_username_error uk-text-danger uk-text-small uk-float-left" style="display:none">Please enter your username.</span>
<input id="username" name="username" type="text" placeholder="Username" class="form-control"></div>
<div class="form-group">
<span class="msg_activation_code_error uk-text-danger uk-text-small uk-float-left" style="display:none">Please enter your activation code.</span>
<input id="verification_code" name="verification_code" type="text" placeholder="Activation Code" value="${param.code}" class="form-control"></div>
<div class="uk-margin uk-grid-small uk-child-width-auto uk-grid uk-text-left uk-grid-stack" uk-grid="">
<div class="uk-width-1-1 uk-grid-margin uk-first-column">
<button type="submit" class="uk-button uk-button-primary" onclick="return validateForm();">Submit</button>
</div>
</div>
</form>
</div>
<!-- END OF REGISTER FORM -->
<script>
$("#username").focusin(function() {
$(this).removeClass('aai-form-danger');
$(".msg_username_error").fadeOut();
$("#server_error").fadeOut();
});
$("#verification_code").focusin(function() {
$(this).removeClass('aai-form-danger');
$(".msg_verification_code_error").fadeOut();
$("#server_error").fadeOut();
});
</script>
</div>
</ul>
</div>
</div>
<!-- END OF CENTER SIDE -->
<div class="uk-flex uk-flex-middle">
<input name="username" class="input uk-text-truncate">
</div>
</div>
</div>
<span id="msg_username_error" class="uk-text-danger uk-text-small" style="display:none">
Please enter your username.
</span>
<c:remove var="msg_username_error" scope="session" />
</div>
</div>
<!-- CONTENT ENDS HERE -->
<!-- FOOTER STARTS HERE-->
<div class="custom-footer" style="z-index: 200;">
<div class="uk-section-primary uk-section uk-section-small">
<div class="uk-container">
<div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid="">
<div class="uk-width-1-1@m uk-first-column">
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-center">
<img alt="OpenAIRE" class="el-image" src="./images/Logo_Horizontal_white_small.png">
</div>
<div class="footer-license uk-margin uk-margin-remove-bottom uk-text-center uk-text-lead">
<div><a href="http://creativecommons.org/licenses/by/4.0/" target="_blank" rel="license"><img alt="Creative" src="./images/80x15.png" style="height: auto; max-width: 100%; vertical-align: middle;"></a>&nbsp;UNLESS OTHERWISE INDICATED, ALL MATERIALS CREATED BY THE OPENAIRE CONSORTIUM ARE LICENSED UNDER A&nbsp;<a href="http://creativecommons.org/licenses/by/4.0/" rel="license">CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE</a>.</div>
<div>OPENAIRE IS POWERED BY&nbsp;<a href="http://www.d-net.research-infrastructures.eu/">D-NET</a>.</div>
</div>
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-right">
<a class="uk-totop uk-icon" href="#" uk-scroll="" uk-totop="">
</a>
</div>
<div input id="verification_code" class="uk-width-medium@s">
<div class="input-wrapper inner x-small">
<div class="input-box">
<div class="placeholder">
<label>Verification Code <sup>*</sup></label>
</div>
<div class="uk-flex uk-flex-middle">
<input name="verification_code" value="${param.code}" class="input uk-text-truncate">
</div>
</div>
</div>
<span id="msg_activation_code_error" class="uk-text-danger uk-text-small" style="display:none">
Please enter your activation code.
</span>
</div>
</div>
<!-- FOOTER ENDS HERE -->
<div class="uk-width-1-1 uk-text-center">
<button type="submit" class="uk-button uk-button-primary" onclick="return validateForm();">
Submit
</button>
</div>
</form>
</div>
</body>
<script>
$("#username input").focusin(function() {
$("#msg_username_error").hide();
$("#server_error").hide();
});
$("#verification_code input").focusin(function() {
$("#msg_activation_code_error").hide();
$("#server_error").hide();
});
</script>
</html>

View File

@ -1,134 +1,74 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
Created by IntelliJ IDEA.
User: sofia
Date: 21/5/2018
Time: 2:45 μμ
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href=".">
<script src="./js/jquery.js"></script>
<script src="./js/uikit.min.js"></script>
<script src="./js/validation.js"></script>
<link rel="stylesheet" style="text/css" href="./css/theme.css">
<link rel="stylesheet" style="text/css" href="./css/custom.css">
<link rel="stylesheet" style="text/css" href="./css/aai-custom.css">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="images/favicon//favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
<title>OpenAIRE - Verification to delete your account</title>
</head>
<body class="" style="">
<div class="uk-offcanvas-content uk-height-viewport">
<!-- MENU STARTS HERE -->
<!-- MAIN MENU STARTS HERE -->
<div class="tm-header tm-header-transparent" uk-header="">
<div class="uk-container uk-container-expand">
<nav class="uk-navbar" uk-navbar="{&quot;align&quot;:&quot;left&quot;}">
<div class="uk-navbar-center">
<div class="uk-logo uk-navbar-item">
<img alt="OpenAIRE" class="uk-responsive-height" src="./images/Logo_Horizontal.png">
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
<jsp:include page="head.jsp">
<jsp:param name="title" value="OpenAIRE - Delete Account Verification"/>
<jsp:param name="form" value="true"/>
</jsp:include>
<body>
<div class="uk-section uk-section-small uk-container uk-container-small">
<div class="uk-text-center">
<img src="images/Logo_Horizontal.png" style="height: 80px;">
<h1 class="uk-h4 uk-margin-large-top">Delete Account Verification</h1>
<div class="uk-margin-large-bottom uk-margin-medium-top">
An <span class="uk-text-bolder">email</span> has been sent to your email address. The email contains a verification code, please paste the verification code in the field below to delete your account.
</div>
</div>
<form action="verifyToDelete" method="POST" role="form"
class="uk-grid uk-child-width-1-1 uk-flex-column uk-flex-middle" uk-grid>
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div id="server_error" class="uk-text-danger uk-text-center uk-text-small">${message}</div>
<c:remove var="message" scope="session" />
<div input id="username" class="uk-width-medium@s">
<div class="input-wrapper inner x-small">
<div class="input-box">
<div class="placeholder">
<label>Username <sup>*</sup></label>
</div>
</div>
</nav>
</div>
</div>
<!-- MENU ENDS HERE -->
<!-- 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" uk-grid="">
</div>
</div>
<div class=" uk-section tm-middle custom-main-content" id="tm-main">
<div class="uk-container uk-container-small uk-margin-small-bottom uk-text-center">
<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 ">
<!-- CENTER SIDE -->
<div class="uk-width-1-1@m uk-width-1-1@s uk-text-center">
<div class="middle-box text-center loginscreen animated fadeInDown ">
<p>An email has been sent to your email address. The email contains a verification code, please paste the verification code in the field below to delete your account.</p>
<div class="uk-width-1-3@m uk-align-center">
<!-- Validate form -->
<div id="registerForm">
<form action="verifyToDelete" method="POST" role="form" class="m-t" id="register_form">
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div class="alert alert-success" aria-hidden="true" style="display: none;"></div>
<div class="alert alert-danger" aria-hidden="true" style="display: none;"></div>
<div class="form-group">
<span id="server_error" class="uk-text-danger uk-text-small uk-float-left">${message}</span>
<c:remove var="message" scope="session" />
<span id="server_username_error" class="uk-text-danger uk-text-small uk-float-left">${msg_username_error}</span>
<c:remove var="msg_username_error" scope="session" />
<input id="username" name="username" type="text" placeholder="Username" class="form-control">
</div>
<div class="form-group">
<span id="server_verification_code_error" class="uk-text-danger uk-text-small uk-float-left">${msg_verification_code_error}</span>
<c:remove var="msg_verification_code_error" scope="session" />
<input id="verification_code" name="verification_code" type="text" placeholder="Verification Code" value="${param.code}" class="form-control">
</div>
<div class="uk-margin uk-grid-small uk-child-width-auto uk-grid uk-text-left uk-grid-stack" uk-grid="">
<div class="uk-width-1-1 uk-grid-margin uk-first-column">
<button type="submit" class="uk-button uk-button-danger" onclick="return validateForm();">Delete Account</button>
</div>
</div>
</form>
</div>
<!-- END OF REGISTER FORM -->
<script>
$("#username").focusin(function() {
$(this).removeClass('aai-form-danger');
$("#server_username_error").fadeOut();
$("#server_error").fadeOut();
});
$("#verification_code").focusin(function() {
$(this).removeClass('aai-form-danger');
$("#server_verification_code_error").fadeOut();
$("#server_error").fadeOut();
});
</script>
</div>
</ul>
</div>
</div>
<!-- END OF CENTER SIDE -->
<div class="uk-flex uk-flex-middle">
<input name="username" class="input uk-text-truncate">
</div>
</div>
</div>
<span id="server_username_error" class="uk-text-danger uk-text-small">
${msg_username_error}
</span>
<c:remove var="msg_username_error" scope="session" />
</div>
</div>
<!-- CONTENT ENDS HERE -->
<!-- FOOTER STARTS HERE-->
<div class="custom-footer" style="z-index: 200;">
<div class="uk-section-primary uk-section uk-section-small">
<div class="uk-container">
<div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid="">
<div class="uk-width-1-1@m uk-first-column">
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-center">
<img alt="OpenAIRE" class="el-image" src="./images/Logo_Horizontal_white_small.png">
</div>
<div class="footer-license uk-margin uk-margin-remove-bottom uk-text-center uk-text-lead">
<div><a href="http://creativecommons.org/licenses/by/4.0/" target="_blank" rel="license"><img alt="Creative" src="./images/80x15.png" style="height: auto; max-width: 100%; vertical-align: middle;"></a>&nbsp;UNLESS OTHERWISE INDICATED, ALL MATERIALS CREATED BY THE OPENAIRE CONSORTIUM ARE LICENSED UNDER A&nbsp;<a href="http://creativecommons.org/licenses/by/4.0/" rel="license">CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE</a>.</div>
<div>OPENAIRE IS POWERED BY&nbsp;<a href="http://www.d-net.research-infrastructures.eu/">D-NET</a>.</div>
</div>
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-right">
<a class="uk-totop uk-icon" href="#" uk-scroll="" uk-totop="">
</a>
</div>
<div input id="verification_code" class="uk-width-medium@s">
<div class="input-wrapper inner x-small">
<div class="input-box">
<div class="placeholder">
<label>Verification Code <sup>*</sup></label>
</div>
<div class="uk-flex uk-flex-middle">
<input name="verification_code" value="${param.code}" class="input uk-text-truncate">
</div>
</div>
</div>
<span id="server_verification_code_error" class="uk-text-danger uk-text-small">
${msg_verification_code_error}
</span>
<c:remove var="msg_verification_code_error" scope="session" />
</div>
</div>
<!-- FOOTER ENDS HERE -->
<div class="uk-width-1-1 uk-text-center">
<button type="submit" class="uk-button uk-button-danger" onclick="return validateForm();">
Delete Account
</button>
</div>
</form>
</div>
</body>
<script>
$("#username input").focusin(function() {
$("#server_username_error").hide();
$("#server_error").hide();
});
$("#verification_code input").focusin(function() {
$("#server_verification_code_error").hide();
$("#server_error").hide();
});
</script>
</html>