isaacsanders / omniauth-stripe-connect

Stripe Connect OAuth2 Strategy for OmniAuth 1.0
MIT License
130 stars 75 forks source link

How to get data from the callback #8

Closed tibbon closed 11 years ago

tibbon commented 11 years ago

I've got it so that Stripe is now sending data back to the callback, and a code is being generated.

But where in the world do I get access to this code to save it? How do I point this to a controller?

isaacsanders commented 11 years ago

You need to define a route handler for "/auth/stripe_connect/callback". I would suggest looking at the documentation for OmniAuth, as they will have more information about the info you have after a successful authentication.

tibbon commented 11 years ago

Ah, I was under the impression that /auth/stripe_connect/callback was already defined somehow from your gem with the build_access_token

On Thu, Nov 29, 2012 at 9:40 AM, Isaac Sanders notifications@github.comwrote:

You need to define a route handler for "/auth/stripe_connect/callback". I would suggest looking at the documentation for OmniAuth, as they will have more information about the info you have after a successful authentication.

— Reply to this email directly or view it on GitHubhttps://github.com/isaacsanders/omniauth-stripe-connect/issues/8#issuecomment-10849412.

bcackerman commented 11 years ago

This is the routes.rb I have and the callbacks aren't going to my callbacks controller

routes: http://pastie.org/5991746

callback controller (omniauth_callbacks_controller.rb): http://pastie.org/5991748

isaacsanders commented 11 years ago

First: Let me know if you know what I am about to say, I hope I don't come across as an ass.

you do not need to redefine the callback route. OmniAuth should create it based on your configuration.

Check here for more info: https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview

On Jan 31, 2013, at 1:33 PM, Bruce Ackerman wrote:

This is the routes.rb I have and the callbacks aren't going to my callbacks controller


devise_scope :user do match '/auth/stripe_connect/callback' => 'omniauth_callbacks#stripe_connect'

Callback controller (omniauth_callbacks_controller.rb):
```class OmniauthCallbacksController < Devise::OmniauthCallbacksController

  def all
    raise request.env["omniauth.auth"].to_yaml
  end
  alias_method :stripe_connect, :all

``` end
—
Reply to this email directly or view it on GitHub.
bcackerman commented 11 years ago

Ah ok so the route is actually http://localhost:3003/users/auth/stripe_connect/callback that you have to make sure to set in Stripe's Account Settings / Applications area as the Redirect URL