spring-session

How to initialize schema in spring-sessiona JDBC

ε祈祈猫儿з 提交于 2020-01-25 03:08:47
问题 I'm using Spring Boot 2.0.x, Hibernate and Spring Session Jdbc with Mysql 5.7. I'm working under development environment, so Hibernate is configured to generate schemas every time: spring.jpa.hibernate.ddl-auto=create-drop And it works fine, but I have a problem with Spring Session... I tried set initialize-schema , but it doesn't work. spring.session.jdbc.initialize-schema=always Is it possible to auto generate full schema (all entities and SPRING_SESSION)? It doesn't work for me with MySQL

Spring security OAuth2 authentication and form login in one app

社会主义新天地 提交于 2020-01-12 08:29:13
问题 Is it possible to combine authoryzation and authentication by login basic and by oauth2 in one application? My project is based on jhipster project with simple spring security session login, now i need add oauth2 security for mobile app and it's look like it is not possible. Now i have situation when work one of them, oauth2 ok if WebSecurityConfigurerAdapter had bigger order number than ResourceServerConfiguration. That's mean if oauth security filter is first. I read a lot in stackoverflow

Not able to capture SessionDestroyed event in Spring Redis Session + Spring boot environment

☆樱花仙子☆ 提交于 2020-01-07 02:58:07
问题 I have a Spring Boot project with Spring Session backed by Redis. I am trying to capture sessionDestroyed event so that I can perform some clean up. The code to capture the event is as below as per guidance I found elsewhere on Stack Overflow. @Component public class SessionEndedListener implements ApplicationListener<SessionDestroyedEvent> { private final Logger LOGGER = LoggerFactory.getLogger(getClass()); @Override public void onApplicationEvent(SessionDestroyedEvent event) { LOGGER.info(

SpringSession DefaultCookieSerializer.setJvmRoute works, but HttpServletRequest does not have the jvmRoute required

耗尽温柔 提交于 2020-01-04 07:14:12
问题 I have implemented Spring Session with Redis in my legacy Spring MVC application. I also used the DefaultCookieSerializer to set the jvmRoute , because I need some server affinity for Talend jobs to be able to run. When I run the front end and inspect the page in Chrome, I see the jvmRoute appended to the session. If I edit this from "node1" to "node2", the session is preserved. If I redeploy the server and make requests during that deployment, I get redirected to another node in the cluster,

Redis Session Serializer mismatch between 3.2 and 4.2

╄→尐↘猪︶ㄣ 提交于 2019-12-30 05:15:05
问题 I have a Spring Cloud-based application running on multiple spring-boot servers. All servers share the same Spring Session using @EnableRedisHttpSession. I now want to integrate a third party widget into my application. Working with the third party, I was able to get initial configuration running, but I'm failing when the third party tries to access the Redis Session data. This is because I am using Spring 4 and the third party uses Spring 3.2. I cannot upgrade the third party's Spring

Session is null on first request

六月ゝ 毕业季﹏ 提交于 2019-12-24 14:18:48
问题 I'm using spring-session and I really like it. However I think I'm missing something. In my application the flow goes like this: 1) User requests HomepageController and that controller tries to put an attribute in the request: HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest(); final String sessionIds = sessionStrategy.getRequestedSessionId(request); if (sessionIds != null) { final ExpiringSession session = sessionRepository

Error starting spring session + redis in docker

流过昼夜 提交于 2019-12-23 20:13:22
问题 I'm trying to complete spring security with angular tutorial from the spring site: https://spring.io/guides/tutorials/spring-security-and-angular-js/ , but I hit the wall during the part about storing data in the redis, because I'm getting the error. The error message: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'enableRedisKeyspaceNotificationsInitializer' defined in class path resource [org/springframework/boot/autoconfigure/session

No converter found capable of converting from type java.lang.Object to type byte[] in JdbcOperationsSessionRepository

前提是你 提交于 2019-12-23 03:25:04
问题 I am trying to store spring session in oracle Db through spring xml based configuration. I have manually created the tables (SPRING_SESSION and SPRING_SESSION_ATTRIBUTES) provided in schema-oracle.sql and provided entries in web.xml and session.xml as suggested in spring doc guide: http://docs.spring.io/spring-session/docs/current/reference/html5/guides/httpsession-jdbc-xml.html jars in WEb-INF/lib/ : spring-web-4.0.2.RELEASE.jar spring-session-1.2.0.RELEASE.jar spring-session-jdbc-1.2.0

Spring security/Spring session/Web sockets

限于喜欢 提交于 2019-12-23 01:49:31
问题 We are attempting to use a combination of spring session, spring security and websockets to implement security for a websocket API without using cookies. Ideally we would be using a authorization header or authentication using the websocket/stomp messages but this does not seem to be possible with the current spring websocket support. We are using a pre-auth provider to validate a query parameter token and log the user in. I can see that the proper user is pulled out in the pre-auth for the

Spring Session Data Redis - Get Valid Sessions, Current User from Redis Store

耗尽温柔 提交于 2019-12-22 03:51:31
问题 My question is, in distributed web application is it possible to get the valid sessions from Redis Store using RedisOperationSessionRepository . (I mean I don't want to write explicit code for putting it into Redis store and then later read it, I want to understand if framework or spring-data-redis library provides that). I am aware that Spring Redis is able to restore sessions and server restarts also preserve the login if the session is still valid (as it is backed by Redis) One of the