Reputation: 501
Im using Goolge openid connect for authenticating user in my application since openid 2.0 is deprecated by google.
When i make Google openid connect request, i get access token from which i get user details and save the user email in application session. So im not using UserService in my approacht o login.
This approach is not providing me logged in user details, when i try the following code,
UserService userService=UserServiceFactory.gerUserService();
User user=userService.getCurrentUser();
In the above code, i get user as null even after user logged in into my application through openid connect.
So the problem is, i am not able to logout user also user is not getting logged out from my application even after logging out from Google. User email is available in application session until user closes the browser.
Upvotes: 0
Views: 733
Reputation: 2542
You need to make sure the page has been set to login: required in your app.yaml. Otherwise it seems to send NULL because the user hasn't explicitly given your page permission to see more info than the email.
Upvotes: 1