I've been working all week to get authentication working. I have gotten it working with
- Ember-CLI
- Ember-Simple-Auth
- Torii
- google-oauth2 provider
However I have proven unsuccessful in getting the users information from google. I have tried creating a torii-adapter as stated in their documentation but it doesn't appear to be called
// app/torii-adapters/application.js
export default Ember.Object.extend({
open: function(authorization){
console.log('authorization from adapter', authorization);
}
});
I've exhausted my google-foo and am asking for your assistance. This is a great library combination for authorization however the documentation is lacking for this case, and when figured out I will be sure to contribute back.
Thank you
The problem I was encountering is Torii's default google-oauth2 provider doesn't access this info for you, also it uses the code workflow instead of the token workflow which is needed for the google+ API
To fix this I wrote a custom provider that uses a jquery GET request to the G+ API, I then return the userName and userEmail to access it in the session under content.
I wrote a full tutorial detailing authorizing an ember app using google start to finish here