title: gem 'omniauth-stripe-connect'-Authentication failure, invalid_credentials, invalid_grant
body: <p>In my view:</p>
  
  <pre><code>&lt;form action="/users/auth/stripe_connect"&gt;
      &lt;input type="hidden" name="response_type" value="code" /&gt;
      &lt;input type="hidden" name="client_id" value="&lt;%= STRIPE_CLIENT_ID %&gt;" /&gt;
      &lt;input type="hidden" name="scope" value="read_write" /&gt;
      &lt;input type="hidden" name="stripe_user[product_category]" value="charity" /&gt;
      &lt;input type="text" placeholder="Enter Amount" name="state"&gt;
      &lt;input class="btn green search_button" type="submit" value="Donate" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>In my development.rb:</p>
  
  <p>STRIPE_CLIENT_ID = 'my client id'
  STRIPE_SECRET = 'my client secret'</p>
  
  <p>In my omniauth_callbacks_controller:</p>
  
  <pre><code>def stripe_connect
      # Delete the code inside of this method and write your own.
      # The code below is to show you where to access the data.
      raise request.env["omniauth.auth"].to_yaml
    end
  </code></pre>
  
  <p>In my routes.rb</p>
  
  <pre><code>devise_for :users, :controllers =&gt; { :omniauth_callbacks =&gt; "omniauth_callbacks" }
  </code></pre>
  
  <p>In my config/initializers/omniauth.rb:</p>
  
  <pre><code> Rails.application.config.middleware.use OmniAuth::Builder do
       provider :stripe_connect, STRIPE_CLIENT_ID, STRIPE_SECRET
    end
  </code></pre>
  
  <p>In my devise.rb</p>
  
  <pre><code>config.omniauth :stripe_connect,
      STRIPE_CLIENT_ID,
      STRIPE_SECRET,
      :scope =&gt; 'read_write', # or :scope =&gt; 'read_only'
      :stripe_landing =&gt; 'login
  </code></pre>
  
  <p>on submitting the form i am redirecting to <a href="https://connect.stripe.com/oauth/authorize" rel="nofollow">https://connect.stripe.com/oauth/authorize</a> but then i am receiving the error on my console </p>
  
  <p>Authentication failure! invalid_credentials: OAuth2::Error, invalid_grant: This authorization code has already been used. All tokens issued with this code have been revoked.
  {
    "error": "invalid_grant",
    "error_description": "This authorization code has already been used. All tokens issued with this code have been revoked."
  }</p>
  
  <p>I already already registered my app on stripe.
  Thanks in advance.</p>