0
votes

I'm using Play-Authenticate to enable users to login using Google account. Login is working fine. Now, I want to show the profile picture of logged in user.

I see that there is a 'picture' field in the provider. com.feth.play.module.pa.providers.oauth2.google.GoogleAuthUser

How can I access this field in my controller so that I can show the picture in my views?

1

1 Answers

0
votes

You need to use instanceof to check if the AuthUser implements com.feth.play.module.pa.user.PicturedIdentity, as GoogleAuthUser does. You can then cast the AuthUser to a PicturedIdentity and invoke getPicture() on it.