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

Dynamic return URL for Google #21

Open
Elexy opened this issue Sep 30, 2013 · 6 comments
Open

Dynamic return URL for Google #21

Elexy opened this issue Sep 30, 2013 · 6 comments

Comments

@Elexy
Copy link

Elexy commented Sep 30, 2013

I am using the OpenID (google) implementation and would like to have dynamic return urls based on the request.

I'm talking about this returnUrl:

 new GoogleStrategy(
      returnURL: process.env.GOOGLE_RETURN_URL or "http://localhost:3333/auth/google/return"
      realm: process.env.GOOGLE_REALM or "http://localhost:3333/"
    , (identifier, profile, done) ->
      userRepository.findOrCreateOauthUser "google", identifier, profile, (user) ->    
        done null, user
    )

I can take the one from env, but I want the hostname+port from the request, because we have multiple hostnames pointing to the IP.

Can it be done with the current passport version?

jfaissolle pushed a commit to jfaissolle/passport-openid that referenced this issue Nov 25, 2013
@mathieumg
Copy link

I would love to see @jfaissolle 's change merged in! :)

@shawnzhu
Copy link

shawnzhu commented Apr 9, 2014

I don't think you can make the domain name part of returnURL option of an OpenID RP dynamic because returnURL is a fixed URL on the RP side and this value will be set once only.

There's one commit on my fork of node-openid, it added query string to returnURL which means only the query string can change. for example:

  • http://localhost:8080/authcallback?url=http://localhost:8080/foo
  • http://localhost:8080/authcallback?url=http://localhost:8080/bar

@lazychino
Copy link

After checking the code, my solution would be give returnURL the path for returning (example: "/auth/google/return") and have authenticate() get the hostname on each request from req.headers.host.

@jfaissolle I didn't saw yours that's a nice solution 👍 we need that PR

@ValentinFunk
Copy link

Any news on this?
Is there any problem with @jfaissolle's solution?

@men232
Copy link

men232 commented Nov 26, 2015

+1

@ghost
Copy link

ghost commented Dec 25, 2015

Would love to be able to pass a custom callbackURL via openid.

👍

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

6 participants