-
Notifications
You must be signed in to change notification settings - Fork 118
Conversation
This is primarily for the oauth redirect flow.
Adding an auth client
…ied in the config
In the future we may want to disconnect after X number of auth failures though.
throw new Error(`Unsupported authentication 'type': ${options.type}`); | ||
} | ||
|
||
// return new Promise(function(resolve, reject) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this commented out code need to kept for reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@daffl No we can get rid of it unless you want to take a crack at it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually didn't read all of it ;) What would it have to do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the promisfying we were trying to do the other night so that a developer doesn't have to call app.io.on('connect', cb)
before they can authenticate. We would handle that for them. I couldn't get it to work. Too many promises and event listeners.
return app.service(options.userEndpoint).create(data, { internal: true }).then(user => { | ||
return done(null, user); | ||
}).catch(done); | ||
}).catch(done); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From 60 to here it can probably just be changed to
return app.service(options.userEndpoint).create(data, { internal: true })).then(user => done(user)).catch(done);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. Passport expects the first param to done
to be an error or null.
Looks like it needs to be merge with master which is hopefully not too much of a disaster. Besides that, let's merge it, make a 0.2.0 release and iterate from there. |
@daffl I had already did that and resolved conflicts. It's good there. All the tests pass locally all the time. I dunno why that one test keeps timing out randomly. I can try setting the mocha timeout higher to see if that works. |
never mind. The latest build did pass on all three platforms now that I added the timeout in the test. I think for some reason the tests were running fast enough that the |
This brings in a pretty major overhaul to feathers authentication. With it comes:
Migrating existing code to use services
Standardizing on a hook spec:
Adds support for authenticating with socketio and primus (Support authenticating with Username and Password via sockets #32)
Only signs the JWT with user id (Only sign the JWT with user id. Not the whole user object #38)
Locks down socket authentication (Discussion: Securing token for socket.io auth #33)
Continues the work @marshallswain did on handling expired tokens (Handling expired tokens #25)
Adds a bunch more tests.
Adds support for OAuth2 (Support OAuth2 #43)
Adds a client side component for easy authentication with Feathers (Add a client side component for authentication #44)
Adds preliminary support for graceful fallback to cookies for JWT (Support graceful fallback to cookies #45)
Adds an example project showing all the different ways you can authenticate