Comments (17)
Just a guess, but what happens if you duplicate your .use() statement for each additional strategy and or create 2 middleware functions? Basically chain connect-auth to itself using a different strategy..
from connect-auth.
I split the .use() in two but nothing changed.
I see some mentions of some scope
in the issues but can't figure out if that's what I need. Do you have any ideas?
from connect-auth.
I saw mention of scopes but I thought it had to do with passing permissions scope to facebook. Did you assign require('connect-auth') twice, so that you had two different vars i.e. c_auth1 and c_auth2? I feel like this solution is kind of hackish, but if you treat the modules as being separate middle-ware, they should ideally play nice.. Also, in order for others to help, you may need to provide more info about what is 'breaking' and the error messages that you are getting. Sorry I only have guesses.. I am kinda new to node :)
from connect-auth.
No, there's some other scope related to connect-auth
itself, saw it in the issue #1.
Requiring the module multiple times is indeed hackish... not sure about that. That doesn't scale either (even though I only have two strategies for now).
As for the error and stuff - I'm not getting any, I just get
18:00:35-851 [tFuUmX] >>> Authenticating (domain.com/connect?login_with=twitter)
18:00:35-851 [tFuUmX] <<< Authentication successful (Already Authenticated)
and that's it, it bypasses the actual authentication with the provider.
from connect-auth.
looks like it is on the todo list.. at line 49 of strategyExecutor
from connect-auth.
I'd start by forking the repo and git grep '(Already Authenticated)' but right now I have a little deadline that only needs the one strategy.
from connect-auth.
Oh, damn. That's not good. I thought someone already had a similar issue and it was resolved, though.
from connect-auth.
Right, I see this issue was resolved.. try passing a scope param in with your strategy config objects and then in your middleware, utilize the isAuthenticated(scope) method as mentioned by the author.
from connect-auth.
Sorry I've been out of the country. Yes scopes is how I would tackle this, I'm going to take a quick look at your use-case and check that it is possible to implement ;)
from connect-auth.
:( It seems scope-passing between requests/re-directs won't currently work ! [this is bad as it isn't just broken for your use-case... but means it is broken for any use-case!]
from connect-auth.
Oh... Hmm. Well, what about requiring twice? Would that work? I haven't had a chance to test that yet.
from connect-auth.
I doubt it... the problem is a little more fundamental.... I'm working up a fix at the mo, but it will require sessions (but the twitter + facebook strategies need that anyway!)
from connect-auth.
I'm ready to test whatever you got, my deadline is approaching (like, in 2 days!) :)
from connect-auth.
Try now. I've published a new version of the API (0.4.1) and a gist can be found here of my testing harness (that I took from your samples) : https://gist.github.com/1193637
Hope this helps :)
P.s. This isn't what I had in mind originally with scopes (that was more for 'log in as Admin' or 'view as end user' style authentication ... but I think this use-case is still valid for that approach!)
from connect-auth.
Cool! I'll test as soon as I get off the bus :D
from connect-auth.
It looks like it's working! Woo!
Thank you!
from connect-auth.
No wOrries, glad you're sorted :)
from connect-auth.
Related Issues (20)
- GET /oauth/authorize doesn't validate oauth_token parameter
- Cannot set property 'twitter_oauth_token_secret' of undefined
- ENOENT on installation HOT 5
- Google2 scopes handled incorrectly
- Modularize
- Per-request scoped scope HOT 5
- session not kept between http callbacks HOT 10
- how to handle authenticated && !req.isAuthenticated()? HOT 18
- Upgrade dependencies to versions that support 0.10.x HOT 1
- Add an explict LICENSE file HOT 1
- Please provide oauth2 client example as oauth2clientapp.js
- Facebook permission Scopes are buggy
- Support connect 2.8.x
- keyfile instructions unclear
- Has this project been abandoned
- upgrade connect to deal with qs vulnerabilities
- tweet on behalf of user HOT 1
- Archive?
- TypeError: Object #<Object> has no method 'fail' HOT 2
- OAuth data provider's tokenByConsumer() allows exactly one request token per consumer HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from connect-auth.