reset password
Author Message
krishnarajen
Posts: 16
Posted 20:05 Mar 01, 2015 |

Hi Professor,

In AuthenticationSuccessHandler the saverequest is always not null and so it is not returning to the desired page which is in defaulturl.

any suggestions please.

cysun
Posts: 2935
Posted 20:08 Mar 01, 2015 |

What do you mean "is always not null"? It should be null if you just go to the login page and log in.

krishnarajen
Posts: 16
Posted 20:39 Mar 01, 2015 |

Yes it should be null if log in is attempted.

I have attached a screenshot where it wasn't getting null before. It works after restarting the eclipse.

Thank you professor.

Attachments:
cysun
Posts: 2935
Posted 20:42 Mar 01, 2015 |

So what's the problem? Do you understand what saved request mean?

krishnarajen
Posts: 16
Posted 20:49 Mar 01, 2015 |

as per my understanding the saverequest has the url which we attempt 1st.

for example.

if I'm trying to access the url which is secured under /admin/**

the spring security first redirects to the login page where it checks the user details and roles then it directs to the url which is specified. so the saverequest has the path which I attempted 1st.

If I'm wrong please elaborate. 

krishnarajen
Posts: 16
Posted 20:49 Mar 01, 2015 |

as per my understanding the saverequest has the url which we attempt 1st.

for example.

if I'm trying to access the url which is secured under /admin/**

the spring security first redirects to the login page where it checks the user details and roles then it directs to the url which is specified. so the saverequest has the path which I attempted 1st.

If I'm wrong please elaborate. 

cysun
Posts: 2935
Posted 20:53 Mar 01, 2015 |

That's exactly right. And it also means that the correct behavior after a successful authentication is that a) redirect to the saved request if it's not null; or b) redirect to default url if it is null.

krishnarajen
Posts: 16
Posted 23:13 Mar 01, 2015 |

Thank you professor