Reputation: 6336
I'm looking into using OAuth2 with Go in Google App Engine.
Here is a link with an example:
https://developers.google.com/appengine/docs/go/users/#Go_OAuth_in_Go
But this remark isn't clear to me:
Note that using OAuth to identify your users is completely orthogonal to the
standard user authentication modes. For example, pages marked with
login: required or login: admin will refuse to load if the user is
only authenticated via OAuth.
Does this mean I can't use the standaard authentication mode with OAuth?
Can I use other providers like Facebook with the user package?
Or is it better to use this package instead of the default user package?
https://code.google.com/p/goauth2/
Are there disadvantages to using this?
(I only need it for authentication)
Upvotes: 1
Views: 569
Reputation: 556
This just means that the app.yaml/module.yaml key "login" won't consider users who have authenticated via OAuth to be authenticated and will deny them access to that resource.
For example, if you have created a page at /admin/ and you want GAE to enforce that only people who have authenticated can access that page, then you need to ensure that they have authenticated using a google account, not an OAuth login. Anyone accessing that after they have logged in using OAuth will still appear unauthenticated to GAE.
All that this means is that if you have pages you only want authenticated people to see and you want to support OAuth as a valid authentication method, then you need to not have the "login" key set for those resources in the .yaml file. Then it's up to you to enforce that they have been logged in before allowing them access to that resource. GAE can't help you out in that case.
Upvotes: 1