0

Having some trouble with my redirect URL for Stripe Connect when hosted on Heroku.

Running locally, it all works as expected, users connect with OAuth, with their publishable key save to the database, and then proceeding as normal through the site.

On Heroku however, users connect to Stripe via OAuth, entering their details and password, then on redirect, they are greeted with the following error message:

Heroku | No such app
There is no app configured at that hostname.
Perhaps the app owner has renamed it, or you mistyped the URL.

The documentation has not helped so far, and I haven't been able to find anything similar on Stack Overflow.

Stripe Details:

Production Redirect URI: https://www.hidden-hamlet-51741.herokuapp.com/oauth/callback

I have played around with some variations, however have had no success.

Heroku Logs:

2016-03-23T13:23:37.799909+00:00 heroku[router]: at=info method=GET path="/users/auth/stripe_connect" host=hidden-hamlet-51741.herokuapp.com request_id=4d52e646-6d02-45be-87e6-7492665c4d17 fwd="86.138.166.211" dyno=web.1 connect=2ms service=19ms status=302 bytes=1549
    2016-03-23T13:23:37.796546+00:00 app[web.1]: Started GET "/users/auth/stripe_connect" for 86.138.166.211 at 2016-03-23 13:23:37 +0000
    2016-03-23T13:23:37.799240+00:00 app[web.1]: I, [2016-03-23T13:23:37.799170 #3]  INFO -- omniauth: (stripe_connect) Request phase initiated.
    2016-03-23T13:30:57.289321+00:00 app[web.1]: Started GET "/users/auth/stripe_connect" for 86.138.166.211 at 2016-03-23 13:30:57 +0000
    2016-03-23T13:30:57.306551+00:00 app[web.1]: I, [2016-03-23T13:30:57.306458 #3]  INFO -- omniauth: (stripe_connect) Request phase initiated.
    2016-03-23T13:30:57.309718+00:00 heroku[router]: at=info method=GET path="/users/auth/stripe_connect" host=hidden-hamlet-51741.herokuapp.com request_id=e7805fd0-3973-4a27-b842-433e1dbb1532 fwd="86.138.166.211" dyno=web.1 connect=2ms service=30ms status=302 bytes=1549

After changing my Production.rb file to have "config.consider_all_requests_local = true", and pushing again to Heroku, the following error message is received:

No route matches [GET] "/oauth/callback"

My Stripe OAuth related routes look like:

user_omniauth_authorize GET|POST /users/auth/:provider(.:format)        omniauth_callbacks#passthru {:provider=>/stripe_connect/}
user_omniauth_callback GET|POST /users/auth/:action/callback(.:format) omniauth_callbacks#(?-mix:stripe_connect)
stripe_connect GET      /stripeconnect(.:format)               groups#stripe

Any pointers would be super helpful.

Thanks.

2 Answers2

1

Answer:

The redirect URL was incorrect on my Stripe Dashboard, /oauth instead of /auth, a simple brain slip.

Then after changing this, I had to run "figaro heroku:set -e production", which I found somewhere on SO, which sets the values of all variables to production, further details in the documentation - https://github.com/laserlemon/figaro

Thanks all,

0

Do you have www configured as a subdomain of hidden-hamlet-51741? If not, then you need to remove www from the production redirect URI. It should look like this:

https://hidden-hamlet-51741.herokuapp.com/oauth/callback

miligraf
  • 1,042
  • 9
  • 22
  • Hi @miligraf, When I try that, removing www, I then receive the following error message from Heroku: "The page you were looking for doesn't exist. You may have mistyped the address or the page may have moved." Any ideas? – Darragh Monaghan Mar 23 '16 at 14:14
  • @DarraghMonaghan something is wrong with your production environment since you say it works in development. Can you get a backtrace on Heroku? You can either add NewRelic to your app or add this line to your production.rb file `config.consider_all_requests_local = true` and redeploy. – miligraf Mar 23 '16 at 14:23
  • So I made that change, pushed to heroku, and attempted the OAuth process again. The error message received: No route matches [GET] "/oauth/callback" The OAuth process is still rather new to me. Any ideas? – Darragh Monaghan Mar 23 '16 at 14:52
  • My stripe related routes look like this: user_omniauth_authorize GET|POST /users/auth/:provider(.:format) omniauth_callbacks#passthru {:provider=>/stripe_connect/} user_omniauth_callback GET|POST /users/auth/:action/callback(.:format) omniauth_callbacks#(?-mix:stripe_connect) stripe_connect GET /stripeconnect(.:format) groups#stripe – Darragh Monaghan Mar 23 '16 at 15:04
  • Forgot to link you in, @miligraf – Darragh Monaghan Mar 23 '16 at 15:56