I read a piece code from my friend but I don't understand why it can run. Here is filter of Grails.
def filters = {
protectResource(uri: "/api/**", uriExclude: "/api/user/*") {
before = {
....
springSecurityService.reauthenticate(authentication.name)
....
}
}
It's like save user session for use later. And here is a piece code for "get user session" by webservice.
@GET
Response getProfile() {
User user = springSecurityService.currentUser
...
}
I think session saved by cookieID between server and browser, if you work by HttpsURLConnection and something like Apache's HttpComponent, you can't save cookieID in that.
I searched somewhere but I'm still confuse about how to save session and security about that phase.
Have any idea about that? Thanks in advance!