Getting the OpenID URL from a Grails Controller/Service
- by firnnauriel
I'm using acegi 0.5.2 and enabled OpenID support. I would like to know how to accesss the URL (or username) returned by a provider (i.e. Google, Yahoo!). I can't find any docs about that so I traced the code of acegi and found this in GrailsOpenIdAuthenticationProvider:
OpenIDAuthenticationToken response = (OpenIDAuthenticationToken) authentication
OpenIDAuthenticationStatus status = response.status
// handle the various possibilites
if (status == OpenIDAuthenticationStatus.SUCCESS) {
// Lookup user details
UserDetails userDetails = _userDetailsService.loadUserByUsername(response.identityUrl)
return new GrailsOpenIdAuthenticationToken(userDetails, response.status, response.identityUrl)
}
it seems that the response.identityUrl contains what i need. How can get it from a controller's (or service's) space?
Thanks.