I want to configure expiredUrl(" ")
feature in my java spring security.
I want to display HTML page when my concurrent session get expired
I tried in following way:-
JAVA
@Override
public void configure(HttpSecurity http) throws Exception {
http
.sessionManagement()
.sessionFixation()
.changeSessionId()
.maximumSessions(1)
.expiredUrl("/session_expired.html")
}
My context path set as localhost:8080/context_path
but
I am not getting how to display session_expired.html
page on expiredUrl call
I am using angularJs on Js side
Please help me to display Html page on expiredUrl call
AND
If I tried with the help of Js then my code is:-
JAVA
@Override
public void configure(HttpSecurity http) throws Exception {
http
.sessionManagement()
.sessionFixation()
.changeSessionId()
.maximumSessions(1)
.expiredUrl("/access/session_expired")
}
ANGULARJS
$stateProvider.state('session_expired', {
'url': '/session_expired',
'templateUrl': '/session_expired.html',
'controller': 'SessionExpiredController'
})
.factory('SessionService', function ($resource, restRoot, contextPath) {
return $resource({
'session_expired': {
'url': contextPath + '/access/session_expired'
},
})
.controller('SessionExpiredController', function (SessionService, $state) {
SessionService.session_expired(function () {
$state.go("session_expired");
});
});
here when session get expired it will goes on link localhost:8080/context_path/session_expired#/landing...
but I want to go on link
localhost:8080/context_path/#/session_expired
OR
I want to display direct HTML page on expiredUrl
so please guide me how to do this.
This configuration is working for me: