I am using play-authenticate to login a user with Google Oauth2. Now I want to get the Access Token so I can use some Google APIs.
Can anyone help me out here? Is it so obvious that I am missing how to do it?
I can get a User like this (from the examples):
final AuthUser u = PlayAuthenticate.getUser(session());
But what I really need is the
OAuth2AuthUser.getOAuth2AuthInfo().getAccessToken()
I can't cast the AuthUser
as an OAuth2AuthUser
. so how can I do it?