Closed digitalplaywright closed 10 years ago
Usually it's not related to oauth flow - just POST user data to your REST API
Correct, signup is not part of the library. You might want to look at ember-data etc. for this.
Also just to be clear: Ember.SimpleAuth is not an OAuth library but a generic authentication/authorization library where one OAuth 2 grant type is simply the default option.
@marcoow Thank you for creating Ember.SimpleAuth.
I see that the sign-up flow is currently not part of the library, and you know better if it makes sense to provide an example of this. However, there seems to be a lot of edge-cases in the sign-up flow and a well thought-out reference implementation along the lines devise:install would be very helpful. For instance, a sign-up flow needs both error handling and auto-sign-in after sign-up. Getting an implementation of this is probably not hard, but doing it in a secure and robust way might be.
Sure, would probably be nice to have a good example somewhere. Maybe you can contribute one for the examples? If you want to have auto-login on registration you can simply trigger session authentication with the username and password you already have in the signup controller when the signup request returns. Sth. like (assuming you want to use ember data):
App.SignupController = Ember.Controller.extend(Ember.SimpleAuth.LoginControllerMixin, {
actions: {
submit: function() {
var _this = this;
this.get('model').save().then(function(model) {
_this.send('authenticate');
});
}
}
});
I've added a repository with a sign-up example here:
An example API server is also available and referenced in the README. I have based this example upon work done by @kagemusha and hope to merge my changes into his repository.
Please let me know if you have any suggestions on how to improve the example, and thank you for this wonderful library!
looks good - thanks!
@digitalplaywright @marcoow thanks this is exactly what I have been looking for :)
@marcoow Many websites, like e.g. https://angel.co/login, has an optional social login. Is it possible with the grant flow used by Ember Simple Auth to sign up and login a user with Facebook? The API Server in this case need Facebook API access after user sign up.
The OAuth 2.0 authenticator that Ember.SimpleAuth has is only one of many possible authenticators - please see the README as well as the examples (there's an example for Facebook authentication).
Where is the latest version of this example?? Did it get merged into the main repository?
I looked at your ember simple auth examples, but I could not see anything documenting best practices for a sign-up user flow. Is there any documentation on recommended practices for a sign-up user flow?