Quantcast

Authentication Plugin User ID

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Authentication Plugin User ID

Ferhat Beyaz
Hi,

I am using the Authentication Plugin here:
http://grails.org/plugin/authentication

Is it possible to get the user ID of the currently logged in user? How
can I achieve that?

Greetings
Ferhat

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Authentication Plugin User ID

Marc Palmer Local

On 31 May 2012, at 21:55, Ferhat Beyaz wrote:

> Hi,
>
> I am using the Authentication Plugin here:
> http://grails.org/plugin/authentication
>
> Is it possible to get the user ID of the currently logged in user? How
> can I achieve that?
>

If you view the source code for authenticationService on github, you will see there is this method:

getSessionUser()


So if you inject authenticationService into your code and get the sessionUser property, you will get the AuthenticationUser object, from that you can get the "login" property.

Regards
Marc

~ ~ ~
Marc Palmer
Freelancer (Grails/Groovy/Java/UX)

I offer commercial support for Grails plugins from as low as $50/mo.
For details see: http://grailsrocks.com

Blog: http://www.anyware.co.uk | Resumé: http://www.anyware.co.uk/marc
Contributor @ http://grails.org |  Founder @ http://noticelocal.com
Developer @ http://weceem.org | Member @ http://spottymushroom.com
Twitter: http://twitter.com/wangjammer5 


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Loading...