scheduling another page instead of home page while login - spring

I am working on a application having spring framework and implemented shiro filter for security.
Login url of my application login page is "localhost:8082/".
but I have changed the url manually "localhost:8082/socialProfile?by=Followers" at time of login.
What I was expecting, after login, instead of scheduling my application home page "http://localhost:8082/dashboard", It should schedule "socialProfile?by=Followers" page.
But it is scheduling "localhost:8082/dashboard" page.
Is there any way to get desired result ?

Related

Spring Security with Ajax Based role login.

I am working On e-commerce project, In my project applying basic spring security role based(form-based) but i need ajax based role login (pop-up). without using redirect strategy because every time it goes to landing page.
case 1: i want below link type login.
https://www.flipkart.com/checkout/init
case 2: if my login is success. i will be on the same page.but in role based
(success handler) navigating to the corresponding role-dashboard.

Redirect to user's web application login url on Jasper server's session time out

I am embedding my Web application reports with tibco-jasper soft version 6 and above server. My users will access their reports from web application by clicking on a link which is provided in web application. There will be separate token validation done for user login from web application to jasper server. I have configured same time for session. When jasper server session's time out, it is getting redirected to jasper's login page. But I just want to redirect that into my custom url (e.g. My web application's login page).
What i can do now? I am new to jasper.
In WEB-INF/jsp/modules/login/login.jsp add this to the top of the file:
<script>
if (window.top != window.self) {
window.parent.location = <your-application-url>;
}
</script>

Spring security redirections inside and outside of a webflow

I'm using for first time spring security (3.2.0.RELEASE) and spring webflow (2.4.0.RC1).
I have some pages where user can login (through a modal window). This logins should not redirect user, instead modal window should be closed and actual page is refreshed in order to show the name of logged user.
In addition, in my web there is a webflow, in this webflow is where an order is created. As a last view-state the user must be logged in order to save the order. So if user is not logged at this point, I redirect him to a login page. If user logs in successfully, his order should keep "alive" and user should be redirected to finish view-state.
How can I configure (I'm using java config) the security of my site ?
I used another approach. I always redirect to same page when a user is authenticated and I've added a special view-state to control registration if user is not logged.

Enter in to a particular page through the browser after I login to the system

Need some idea on the process to land in a page after I login to my web portal. My requirement is I will enter Url of a particular page in to the browser, then system will check is the user is login to the system, if yes it will land on the page I have entered but if not then system will take me to the login page and after successful login I will be landed in to the page I have entered in the browser.
So, please tell me how to do it in plain servlet/Jsp model, Spring and Struts 1 and Struts 2.
Any post will be helpful
I know about basic jsp/servlet model.
Write a Servlet filter which will intercept every request from the brwoser, there check is the user is logged in or not. If logged in your normal flow will continue but if not then redirect to the login page. When you are redirecting to the login page, make sure you send the url hit by browser in the response. Now in client side hold the url send in response and after eneter credentials in login page when user will submit the record send the url (Hold in the client side from response) in the request and after successful login use Servelet Request dispatcher to land in the url.
I am not sure but spring-security has this feature and struts 2. But implementation process can be share by others who are familiar on this technologies. But in struts 1 it's not available and you have to do it manually.
it will very easy with spring security you just need to secure some path pattern. you doesn't need to add some code in your jsp or controller, example
for url /admin/* need administrator role
for url /user/* need user role
for url /public/* no need login (anynomous)
it just need configure at your spring-security.xml
you can start here

Spring/Tomcat 6 Session Expiration Issue

I'm using Spring MVC for a personal webpage with a local Tomcat 6 server. I'm using a default Tomcat configuration(what eclipse would setup by default).
In my controllers(using one controller for each page, and creating Session beans to pass information between them) I have two methods, one for capturing a POST and one for capturing a GET Request Method. The page logic will have the user click a submit button and will use a "redirect:abc.htm" return to send them to a new page or back to the GET method.
I'm not explicitly handling cookies, but do have all the information in Session Beans and am using Spring Security to handle security/user management.
I have a spring security configuration to redirect the user back to the login page if they are not authorized. I also have an ExceptionHandler catching HttpSessionRequiredException, though this is not what is triggering when I expire the user sessions(it's using the logic of my Spring Security configuration).
When the session is expired(I'm doing this through Tomcat manager) the user is redirected back to the login page. They are redirected after they try to do something(click a submit, or revisit any page except login.htm).
My issue is that once they get back to the initial page that their session expired at, if at the time of expiration they clicked a submit button, it is redirecting them past the initial page and handling the POST event from the submit.
Example:
User is logged in, and on the main page
User Session Expires
User, on the main page, click a submit button
User is redirected back to the login.htm page
User logs in and navigates back to the main page.
Instead of following the logic of the GET for the main page, they are treated to the POST of the main page, and I'm not sure where the POST variables are coming from.
Is there any way to trace where this error is coming from or what exactly is causing it?
This is done by spring-security. Spring security stores the request details in the session before redirecting the user to the login page. On successful login it will retrieve the request details from the session and redirect to that.
You can set the always-use-default-target attribute of the form-login configuration to override this behavior.

Resources