Giter Club home page Giter Club logo

Comments (17)

misterinterrupt avatar misterinterrupt commented on May 10, 2024

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.

diversario avatar diversario commented on May 10, 2024

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.

misterinterrupt avatar misterinterrupt commented on May 10, 2024

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.

diversario avatar diversario commented on May 10, 2024

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.

misterinterrupt avatar misterinterrupt commented on May 10, 2024

looks like it is on the todo list.. at line 49 of strategyExecutor

from connect-auth.

misterinterrupt avatar misterinterrupt commented on May 10, 2024

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.

diversario avatar diversario commented on May 10, 2024

Oh, damn. That's not good. I thought someone already had a similar issue and it was resolved, though.

from connect-auth.

misterinterrupt avatar misterinterrupt commented on May 10, 2024

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.

ciaranj avatar ciaranj commented on May 10, 2024

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.

ciaranj avatar ciaranj commented on May 10, 2024

:( 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.

diversario avatar diversario commented on May 10, 2024

Oh... Hmm. Well, what about requiring twice? Would that work? I haven't had a chance to test that yet.

from connect-auth.

ciaranj avatar ciaranj commented on May 10, 2024

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.

diversario avatar diversario commented on May 10, 2024

I'm ready to test whatever you got, my deadline is approaching (like, in 2 days!) :)

from connect-auth.

ciaranj avatar ciaranj commented on May 10, 2024

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.

diversario avatar diversario commented on May 10, 2024

Cool! I'll test as soon as I get off the bus :D

from connect-auth.

diversario avatar diversario commented on May 10, 2024

It looks like it's working! Woo!

Thank you!

from connect-auth.

ciaranj avatar ciaranj commented on May 10, 2024

No wOrries, glad you're sorted :)

from connect-auth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.