GWTP CarStore security not authorized and browser reload

32 views
Skip to first unread message

István Horváth

unread,
Oct 4, 2015, 11:03:36 AM10/4/15
to GWTP
Hi,

I am fairly new to GWTP, but not to GWT.
I just started to investigate an issue in my project, and it seems there is a similar issue in the Car Store example.

I am running this example in my IDEA and when I am logging in in a browser with the predefined user/password (admin/qwerty) than it is everything okay.
Could login successfully and could use the stuff, but when i am hitting browser reload button of the browser than the application redirects me to the unauthorized page which shows me:
"You are not authorized to view this page."
When clicking on the login link than it is automatically logs me in and shows the requested place without entering the user/password again.

My question: is this behavior intentional? how can i modify this app to log me in automatically when i am hitting the reload button? Of course with a very nice solution!

thanks

Tomek Kańka

unread,
Oct 5, 2015, 6:57:55 PM10/5/15
to GWTP
W dniu niedziela, 4 października 2015 17:03:36 UTC+2 użytkownik István Horváth napisał:
Hi,

[...]

My question: is this behavior intentional? how can i modify this app to log me in automatically when i am hitting the reload button? Of course with a very nice solution!



Popular solution is:
- put information about logged user in session (rather common for webapps)
- create dynamic host page (jsp) for GWT app  with

<script>
var user = { 
  "userName" : "Admin" ,
"userRole" : "5" ,
"userId" : "5"
}
</script>

- retrieve this in EntryPoint with

Dictionary.getDictionary("user");


Reply all
Reply to author
Forward
0 new messages