Getting the OpenID URL from a Grails Controller/Service

Posted by firnnauriel on Stack Overflow See other posts from Stack Overflow or by firnnauriel
Published on 2010-03-15T10:28:17Z Indexed on 2010/03/15 10:29 UTC
Read the original article Hit count: 379

Filed under:
|
|
|

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.

© Stack Overflow or respective owner

Related posts about grails

Related posts about acegi