• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Spring-MVC application URL CORS issue

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In ou application we are using AngularJS, SpringMVC 5, Tomcat and single-sign-on (SSO). Issue is when the application session is timed-out or Invalid session, the application URL is not redirected back to login page. I am getting CORS error message.

I referred to the below link by changing the dispatcher-servlet and spring-security settings but it did not work.
https://stackoverflow.com/questions/46897681/issue-when-enable-cors-on-spring-security

Here is the sample JavaScript code for Invalid Session and Session timeout, please help how to apply CORS on the below code.



dispatcher-servlet


spring-security
 
Bartender
Posts: 565
14
IntelliJ IDE Spring Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where are you getting the CORS error exactly? That is for asynchronous requests, not browser navigation.
 
mansree sreeal
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1) I have a logout link in my application, while clicking on the logout link, page redirect to logout without any issues.

2) When there is no user intervention on the application for 20 minutes, the session expires and while clicking on any of the links, it is not redirecting to logout page and here I see the CORS error message (in the browser developer tools).

3) I also have a popup window (AngularJS code) for the session time extension having Continue and Exit button. If I click on the Exit button, it is not redirecting to logout page. Here too I see the same CORS error message.

The Application and Logout page are two different domain URLs. In this application, we use SSO for login and logout.
 
Al Hobbs
Bartender
Posts: 565
14
IntelliJ IDE Spring Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are using JSP for the front end it would be easier to handle the redirects on the backend
 
reply
    Bookmark Topic Watch Topic
  • New Topic