richardvanhook / databasedotcom-oauth2

MIT License
14 stars 6 forks source link

issues selecting between endpoints #5

Open mattieruth opened 9 years ago

mattieruth commented 9 years ago

Hi,

I've been using your sample login application (databasedotcom-oauth2-sinatra-jqm) and the code in this gem to try and set up a log in page for users to select which endpoint they should log in through. I have set up my endpoints like so:

use Databasedotcom::OAuth2::WebServerFlow,
  :debugging            => true,
  :token_encryption_key => Base64.strict_decode64(settings.force['encrypt_key']),
  :display              => "touch", # will force salesforce login to be optimized for touch
  :endpoints            => {"login.salesforce.com" => {
                              :key    => settings.force['client_id'],
                              :secret => settings.force['client_secret']},
                            "myco.secure.force.com" => {
                              :key    => settings.force['client_id'],
                              :secret => settings.force['client_secret']}}

And my login page has two links:

- Click [here](/auth/salesforce?state=%2F&terms=on&endpoint=login.salesforce.com) to login through salesforce.

- Click [here](/auth/salesforce) to login through customer portal.

However I can never get the gem to take the login.salesforce.com. It will always try to use myco.secure.force.com (or whichever is last in the endpoints list).

I have tried all permutations of the /auth/salesforce link. In reading the gem, I would think that the following should work:

/auth/salesforce?endpoint=login.salesforce.com

but no cigar. I've even tried using the exact link from the sinatra sample you've provided and it ignores the endpoint there. Is there a setting I am supposed to change to allow the endpoints to be selected?

Thank you, ~mattie ruth

RedaBenh commented 8 years ago

i have de same issue when i try to set the endpoint throw params ! Do you have any update about this issues ?

Thanks