Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call back URL can be "/auth" + name + "/callback" #1

Open
Ziink opened this issue Nov 14, 2012 · 6 comments
Open

Call back URL can be "/auth" + name + "/callback" #1

Ziink opened this issue Nov 14, 2012 · 6 comments

Comments

@Ziink
Copy link

Ziink commented Nov 14, 2012

Following line in index.js works fine with Facebook
_.defaults(obj.conf, {callbackURL: "/auth/" + name + "/callback"})

@lefnire
Copy link
Owner

lefnire commented Nov 14, 2012

what do you mean?

@Ziink
Copy link
Author

Ziink commented Nov 14, 2012

    // Provide default values for options not passed in
    // TODO pass in as conf URL variable
    _.defaults(obj.conf, {callbackURL: "http://localhost:3000/auth/" + name + "/callback"})

The above lines are from index.js and it wasn't working for me because of localhost:3000 since I was trying with a domain name. So just using
_.defaults(obj.conf, {callbackURL: "/auth/" + name + "/callback"})
takes care of that for now.

@lefnire
Copy link
Owner

lefnire commented Nov 14, 2012

I see. Unfortunately that doesn't work for the other 3 providers, it causes url redirect error. Any thoughts? Could just have user pass in domain as initialization options. Unfortunately determining domain programmatically has to be done in a middleware via req, which is too late after initialization of the Passport components.

@lefnire
Copy link
Owner

lefnire commented Nov 14, 2012

You can currently get around all that by just passing in callbackURL option in your server/index.js per strategy (as per the twitter & github examples), but that's a pain

@Ziink
Copy link
Author

Ziink commented Nov 15, 2012

The derby-auth module already accepts the callbackURL in 'conf' from the app (example/src/server/index.coffee)

The default of

_.defaults(obj.conf, {callbackURL: "/auth/" + name + "/callback"})

already works for Facebook and Github. For Twitter I had to specify the callbackURL with the domain name in example/src/server/index.coffee, and that works.

@moiseevigor
Copy link

Sorry guys I'm lost with callbacks. Cannot understand how to obtain the access token, I suppose it should be the kind of callback function which receives the token after successful authentication
https://github.com/jaredhanson/passport-instagram#usage

As you may see I'm working with instagram startegy and derby-auth and cannot come out. Any help is welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants