Revision 50160
Added by Stefanos Gatsios over 6 years ago
modules/dnet-openaire-users/branches/redis/src/main/webapp/WEB-INF/security-context.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<beans:beans xmlns="http://www.springframework.org/schema/security" |
|
3 |
xmlns:beans="http://www.springframework.org/schema/beans" |
|
4 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
5 |
xmlns:security="http://www.springframework.org/schema/security" |
|
6 |
xsi:schemaLocation=" |
|
7 |
http://www.springframework.org/schema/beans |
|
8 |
http://www.springframework.org/schema/beans/spring-beans.xsd |
|
9 |
|
|
10 |
http://www.springframework.org/schema/security |
|
11 |
http://www.springframework.org/schema/security/spring-security.xsd"> |
|
12 |
|
|
13 |
<!-- Stateless RESTful services use BASIC authentication --> |
|
14 |
<!--<security:http create-session="stateless" pattern="/rest/**"> |
|
15 |
<security:intercept-url pattern="/**" access="ROLE_REST"/> |
|
16 |
<security:http-basic/> |
|
17 |
</security:http> |
|
18 |
|
|
19 |
|
|
20 |
<security:authentication-manager> |
|
21 |
<security:authentication-provider> |
|
22 |
<security:user-service> |
|
23 |
<security:user name="rest" password="rest" authorities="ROLE_REST"/> |
|
24 |
</security:user-service> |
|
25 |
</security:authentication-provider> |
|
26 |
</security:authentication-manager> |
|
27 |
--> |
|
28 |
<!-- |
|
29 |
<authentication-manager alias="authenticationManager"> |
|
30 |
<authentication-provider ref="jwtAuthenticationProvider" /> (8) |
|
31 |
</authentication-manager> |
|
32 |
|
|
33 |
--> |
|
34 |
</beans:beans> |
modules/dnet-openaire-users/branches/redis/src/main/webapp/WEB-INF/dispatcher-servlet.xml | ||
---|---|---|
1 |
<beans xmlns="http://www.springframework.org/schema/beans" |
|
2 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
3 |
xsi:schemaLocation="http://www.springframework.org/schema/beans |
|
4 |
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> |
|
5 |
|
|
6 |
</beans> |
modules/dnet-openaire-users/branches/redis/src/main/java/eu/dnetlib/openaire/usermanagement/security/FrontEndLinkURIAuthenticationSuccessHandler.java | ||
---|---|---|
41 | 41 |
logger.info("\n////////////////////////////////////////////////////////////////////////////////////////////////\n"); |
42 | 42 |
|
43 | 43 |
jwt.setPath(frontPath); |
44 |
jwt.setDomain(frontDomain); |
|
44 |
if (frontDomain!=null) jwt.setDomain(frontDomain);
|
|
45 | 45 |
accessToken.setPath(frontPath); |
46 |
accessToken.setDomain(frontDomain); |
|
46 |
if (frontDomain!=null) accessToken.setDomain(frontDomain);
|
|
47 | 47 |
|
48 | 48 |
response.addCookie(jwt); |
49 | 49 |
response.addCookie(accessToken); |
modules/dnet-openaire-users/branches/redis/src/main/java/eu/dnetlib/openaire/usermanagement/registry/beans/Config.java | ||
---|---|---|
3 | 3 |
import org.apache.log4j.Logger; |
4 | 4 |
import org.springframework.beans.factory.annotation.Value; |
5 | 5 |
import org.springframework.context.annotation.Bean; |
6 |
import org.springframework.context.annotation.ComponentScan; |
|
7 | 6 |
import org.springframework.context.annotation.Configuration; |
8 |
import org.springframework.context.annotation.PropertySource; |
|
9 | 7 |
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; |
10 | 8 |
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession; |
11 | 9 |
import org.springframework.session.web.http.CookieSerializer; |
... | ... | |
17 | 15 |
|
18 | 16 |
@Configuration |
19 | 17 |
@EnableRedisHttpSession |
20 |
//@PropertySource(value = { "classpath:eu/dnet/openaire/usermanagement/redis.properties"} ) |
|
21 | 18 |
public class Config { |
22 | 19 |
|
23 | 20 |
private static Logger logger = Logger.getLogger(Config.class); |
modules/dnet-openaire-users/branches/redis/src/main/webapp/WEB-INF/springContext-dnetOpenaireUsersService.xml | ||
---|---|---|
61 | 61 |
<bean id="webexpressionHandler" |
62 | 62 |
class="org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler"/> |
63 | 63 |
|
64 |
|
|
65 | 64 |
<bean id="authenticationEntryPoint" class="org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint" > |
66 | 65 |
<constructor-arg type="java.lang.String" value="/openid_connect_login"/> |
67 | 66 |
</bean> |
... | ... | |
95 | 94 |
<bean class="eu.dnetlib.openaire.usermanagement.security.FrontEndLinkURIAuthenticationSuccessHandler" id="frontEndRedirect"> |
96 | 95 |
<property name="frontEndURI" value="${webbapp.front}"/> |
97 | 96 |
<property name="frontPath" value="${webbapp.front.path}"/> |
98 |
<property name="frontDomain" value="${webbapp.front.domain}"/> |
|
97 |
<property name="frontDomain" value="${webbapp.front.domain:#{null}}"/>
|
|
99 | 98 |
</bean> |
100 | 99 |
|
101 | 100 |
<!--<bean id="securityContextLogoutHandler" class="org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler"/>--> |
modules/dnet-openaire-users/branches/redis/src/main/webapp/WEB-INF/applicationContext.xml | ||
---|---|---|
8 | 8 |
http://www.springframework.org/schema/context |
9 | 9 |
http://www.springframework.org/schema/context/spring-context-4.2.xsd"> |
10 | 10 |
|
11 |
|
|
12 |
<context:component-scan base-package="eu.dnetlib.openaire.usermanagement.registry.beans"/> |
|
13 |
<context:annotation-config /> |
|
14 |
|
|
11 | 15 |
<import resource="classpath*:/eu/dnetlib/openaire/user/springContext-userManagementService.xml" /> |
12 | 16 |
|
17 |
<!--<bean id="webexpressionHandler"--> |
|
18 |
<!--class="org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler"/>--> |
|
19 |
|
|
20 |
|
|
13 | 21 |
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> |
14 | 22 |
<property name="order" value="2" /> |
15 | 23 |
<property name="ignoreUnresolvablePlaceholders" value="true" /> |
... | ... | |
25 | 33 |
<value>classpath*:/eu/**/applicationContext*.properties</value> |
26 | 34 |
<value>classpath*:/eu/dnetlib/applicationContext-defaultProperties.properties</value> |
27 | 35 |
<value>classpath*:/eu/**/springContext-userManagementService.properties</value> |
28 |
<value>classpath*:/eu/**/springContext-dnetOpenaireUsersService.properties</value> |
|
36 |
<value>classpath*:/eu/**/springContext-dnetOpenaireUsersService.properties</value> |
|
37 |
<value>classpath*:/eu/**/redis.properties</value> |
|
29 | 38 |
<value>classpath*:/uoa-override.properties</value> |
30 | 39 |
<value>classpath*:/dnet-override.properties</value> |
31 | 40 |
</list> |
32 | 41 |
</property> |
33 | 42 |
</bean> |
34 | 43 |
|
35 |
<context:annotation-config /> |
|
36 |
|
|
37 |
</beans> |
|
44 |
</beans> |
modules/dnet-openaire-users/branches/redis/src/main/webapp/WEB-INF/web.xml | ||
---|---|---|
3 | 3 |
|
4 | 4 |
<display-name>uoa-user-management</display-name> |
5 | 5 |
<context-param> |
6 |
<param-name>webAppRootKey</param-name> |
|
7 |
<param-value>redis</param-value> |
|
8 |
</context-param> |
|
9 |
<context-param> |
|
10 | 6 |
<param-name>contextConfigLocation</param-name> |
11 | 7 |
<param-value> |
12 | 8 |
/WEB-INF/applicationContext.xml |
13 |
/WEB-INF/security-context.xml |
|
14 | 9 |
/WEB-INF/springContext-dnetOpenaireUsersService.xml |
15 | 10 |
</param-value> |
16 | 11 |
</context-param> |
... | ... | |
152 | 147 |
</filter-mapping> |
153 | 148 |
|
154 | 149 |
<filter> |
150 |
<filter-name>springSessionRepositoryFilter</filter-name> |
|
151 |
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> |
|
152 |
</filter> |
|
153 |
<filter-mapping> |
|
154 |
<filter-name>springSessionRepositoryFilter</filter-name> |
|
155 |
<url-pattern>/*</url-pattern> |
|
156 |
<dispatcher>REQUEST</dispatcher> |
|
157 |
<dispatcher>ERROR</dispatcher> |
|
158 |
</filter-mapping> |
|
159 |
|
|
160 |
<filter> |
|
155 | 161 |
<filter-name>springSecurityFilterChain</filter-name> |
156 | 162 |
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> |
157 | 163 |
</filter> |
modules/dnet-openaire-users/branches/redis/src/main/webapp/index.jsp | ||
---|---|---|
1 | 1 |
<html> |
2 | 2 |
<body> |
3 | 3 |
<h2>Hello World!</h2> |
4 |
<h4>${pageContext.session.id}</h4> |
|
4 | 5 |
</body> |
5 | 6 |
</html> |
modules/dnet-openaire-users/branches/redis/pom.xml | ||
---|---|---|
1 | 1 |
<?xml version="1.0" encoding="UTF-8"?> |
2 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
|
3 |
<parent> |
|
4 |
<groupId>eu.dnetlib</groupId> |
|
5 |
<artifactId>dnet45-container-parent</artifactId> |
|
6 |
<version>1.0.0</version> |
|
7 |
</parent> |
|
8 |
<modelVersion>4.0.0</modelVersion> |
|
9 |
<groupId>eu.dnetlib</groupId> |
|
10 |
<artifactId>dnet-openaire-users</artifactId> |
|
11 |
<packaging>war</packaging> |
|
12 |
<version>1.0.0-SNAPSHOT</version> |
|
13 |
<scm> |
|
14 |
<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaire-users/branches/redis</developerConnection> |
|
15 |
</scm> |
|
16 |
<dependencies> |
|
17 |
<dependency> |
|
18 |
<groupId>eu.dnetlib</groupId> |
|
19 |
<artifactId>uoa-user-management</artifactId> |
|
20 |
<version>[2.0.0-SNAPSHOT, 3.0.0)</version> |
|
21 |
</dependency> |
|
22 |
<dependency> |
|
23 |
<groupId>eu.dnetlib</groupId> |
|
24 |
<artifactId>dnet-runtime</artifactId> |
|
25 |
<version>[1.0.0, 2.0.0)</version> |
|
26 |
</dependency> |
|
27 |
<dependency> |
|
28 |
<groupId>org.apache.cxf</groupId> |
|
29 |
<artifactId>cxf-rt-transports-http</artifactId> |
|
30 |
<version>${cxf.version}</version> |
|
31 |
</dependency> |
|
2 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
3 |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
|
4 |
<parent> |
|
5 |
<groupId>eu.dnetlib</groupId> |
|
6 |
<artifactId>dnet45-container-parent</artifactId> |
|
7 |
<version>1.0.0-SNAPSHOT</version> |
|
8 |
</parent> |
|
9 |
<modelVersion>4.0.0</modelVersion> |
|
10 |
<groupId>eu.dnetlib</groupId> |
|
11 |
<artifactId>dnet-openaire-users</artifactId> |
|
12 |
<packaging>war</packaging> |
|
13 |
<version>1.0.0-SNAPSHOT</version> |
|
14 |
<scm> |
|
15 |
<developerConnection> |
|
16 |
scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-openaire-users/branches/redis |
|
17 |
</developerConnection> |
|
18 |
</scm> |
|
19 |
<dependencies> |
|
32 | 20 |
<dependency> |
21 |
<groupId>eu.dnetlib</groupId> |
|
22 |
<artifactId>uoa-user-management</artifactId> |
|
23 |
<version>[2.0.0-SNAPSHOT, 3.0.0)</version> |
|
24 |
</dependency> |
|
25 |
<dependency> |
|
26 |
<groupId>org.slf4j</groupId> |
|
27 |
<artifactId>slf4j-api</artifactId> |
|
28 |
<version>1.7.5</version> |
|
29 |
</dependency> |
|
30 |
<dependency> |
|
31 |
<groupId>org.slf4j</groupId> |
|
32 |
<artifactId>slf4j-log4j12</artifactId> |
|
33 |
<version>1.7.5</version> |
|
34 |
</dependency> |
|
35 |
<dependency> |
|
36 |
<groupId>eu.dnetlib</groupId> |
|
37 |
<artifactId>dnet-runtime</artifactId> |
|
38 |
<version>[1.0.0, 2.0.0)</version> |
|
39 |
</dependency> |
|
40 |
<dependency> |
|
41 |
<groupId>org.apache.cxf</groupId> |
|
42 |
<artifactId>cxf-rt-transports-http</artifactId> |
|
43 |
<version>${cxf.version}</version> |
|
44 |
</dependency> |
|
45 |
<dependency> |
|
33 | 46 |
<groupId>jstl</groupId> |
34 | 47 |
<artifactId>jstl</artifactId> |
35 | 48 |
<version>1.2</version> |
36 | 49 |
</dependency> |
37 |
<dependency>
|
|
38 |
<groupId>javax.servlet</groupId>
|
|
39 |
<artifactId>javax.servlet-api</artifactId>
|
|
40 |
<version>3.0.1</version>
|
|
41 |
</dependency>
|
|
42 |
<dependency>
|
|
43 |
<groupId>eu.dnetlib</groupId>
|
|
44 |
<artifactId>uoa-user-management</artifactId>
|
|
45 |
<version>2.0.0-SNAPSHOT</version>
|
|
46 |
</dependency>
|
|
47 |
<dependency>
|
|
48 |
<groupId>org.springframework.security</groupId>
|
|
49 |
<artifactId>spring-security-core</artifactId>
|
|
50 |
<version>4.2.1.RELEASE</version>
|
|
51 |
</dependency>
|
|
52 |
<dependency>
|
|
53 |
<groupId>org.springframework.security</groupId>
|
|
54 |
<artifactId>spring-security-config</artifactId>
|
|
55 |
<version>4.2.1.RELEASE</version>
|
|
56 |
</dependency>
|
|
57 |
<dependency>
|
|
58 |
<groupId>org.springframework.security</groupId>
|
|
59 |
<artifactId>spring-security-web</artifactId>
|
|
60 |
<version>4.2.1.RELEASE</version>
|
|
61 |
</dependency>
|
|
62 |
<dependency>
|
|
63 |
<groupId>com.google.code.gson</groupId>
|
|
64 |
<artifactId>gson</artifactId>
|
|
65 |
<version>2.6.2</version>
|
|
66 |
</dependency>
|
|
67 |
<dependency>
|
|
68 |
<groupId>javax.servlet</groupId>
|
|
69 |
<artifactId>javax.servlet-api</artifactId>
|
|
70 |
<version>3.0.1</version>
|
|
71 |
<scope>provided</scope>
|
|
72 |
</dependency>
|
|
50 |
<dependency>
|
|
51 |
<groupId>javax.servlet</groupId>
|
|
52 |
<artifactId>javax.servlet-api</artifactId>
|
|
53 |
<version>3.0.1</version>
|
|
54 |
</dependency>
|
|
55 |
<dependency>
|
|
56 |
<groupId>eu.dnetlib</groupId>
|
|
57 |
<artifactId>uoa-user-management</artifactId>
|
|
58 |
<version>2.0.0-SNAPSHOT</version>
|
|
59 |
</dependency>
|
|
60 |
<dependency>
|
|
61 |
<groupId>org.springframework.security</groupId>
|
|
62 |
<artifactId>spring-security-core</artifactId>
|
|
63 |
<version>4.2.1.RELEASE</version>
|
|
64 |
</dependency>
|
|
65 |
<dependency>
|
|
66 |
<groupId>org.springframework.security</groupId>
|
|
67 |
<artifactId>spring-security-config</artifactId>
|
|
68 |
<version>4.2.1.RELEASE</version>
|
|
69 |
</dependency>
|
|
70 |
<dependency>
|
|
71 |
<groupId>org.springframework.security</groupId>
|
|
72 |
<artifactId>spring-security-web</artifactId>
|
|
73 |
<version>4.2.1.RELEASE</version>
|
|
74 |
</dependency>
|
|
75 |
<dependency>
|
|
76 |
<groupId>com.google.code.gson</groupId>
|
|
77 |
<artifactId>gson</artifactId>
|
|
78 |
<version>2.6.2</version>
|
|
79 |
</dependency>
|
|
80 |
<dependency>
|
|
81 |
<groupId>javax.servlet</groupId>
|
|
82 |
<artifactId>javax.servlet-api</artifactId>
|
|
83 |
<version>3.0.1</version>
|
|
84 |
<scope>provided</scope>
|
|
85 |
</dependency>
|
|
73 | 86 |
|
74 |
<dependency>
|
|
75 |
<groupId>org.mitre</groupId>
|
|
76 |
<artifactId>openid-connect-client</artifactId>
|
|
77 |
<version>1.3.0</version>
|
|
78 |
</dependency>
|
|
87 |
<dependency>
|
|
88 |
<groupId>org.mitre</groupId>
|
|
89 |
<artifactId>openid-connect-client</artifactId>
|
|
90 |
<version>1.3.0</version>
|
|
91 |
</dependency>
|
|
79 | 92 |
|
80 | 93 |
|
81 |
<!-- About redis -->
|
|
94 |
<!-- About redis -->
|
|
82 | 95 |
|
83 |
<dependency>
|
|
84 |
<groupId>org.springframework.session</groupId>
|
|
85 |
<artifactId>spring-session-data-redis</artifactId>
|
|
86 |
<version>1.3.1.RELEASE</version>
|
|
87 |
<type>pom</type>
|
|
88 |
</dependency>
|
|
89 |
<dependency>
|
|
90 |
<groupId>biz.paluch.redis</groupId>
|
|
91 |
<artifactId>lettuce</artifactId>
|
|
92 |
<version>3.5.0.Final</version>
|
|
93 |
</dependency>
|
|
94 |
<dependency>
|
|
95 |
<groupId>org.springframework</groupId>
|
|
96 |
<artifactId>spring-web</artifactId>
|
|
97 |
<version>4.3.4.RELEASE</version>
|
|
98 |
</dependency>
|
|
96 |
<dependency>
|
|
97 |
<groupId>org.springframework.session</groupId>
|
|
98 |
<artifactId>spring-session-data-redis</artifactId>
|
|
99 |
<version>1.3.1.RELEASE</version>
|
|
100 |
<type>pom</type>
|
|
101 |
</dependency>
|
|
102 |
<dependency>
|
|
103 |
<groupId>biz.paluch.redis</groupId>
|
|
104 |
<artifactId>lettuce</artifactId>
|
|
105 |
<version>3.5.0.Final</version>
|
|
106 |
</dependency>
|
|
107 |
<dependency>
|
|
108 |
<groupId>org.springframework</groupId>
|
|
109 |
<artifactId>spring-web</artifactId>
|
|
110 |
<version>4.3.4.RELEASE</version>
|
|
111 |
</dependency>
|
|
99 | 112 |
|
100 |
</dependencies>
|
|
113 |
</dependencies>
|
|
101 | 114 |
</project> |
102 | 115 |
|
Also available in: Unified diff