Google OAuth 2 authorization - Error: redirect_uri_mismatch

前端 未结 30 2345
遥遥无期
遥遥无期 2020-11-22 02:58

On the website https://code.google.com/apis/console I have registered my application, set up generated Client ID: and Client Secret to my a

30条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-22 03:13

    Rails users (from the omniauth-google-oauth2 docs):

    Fixing Protocol Mismatch for redirect_uri in Rails

    Just set the full_host in OmniAuth based on the Rails.env.

    # config/initializers/omniauth.rb

    OmniAuth.config.full_host = Rails.env.production? ? 'https://domain.com' : 'http://localhost:3000'

    REMEMBER: Do not include the trailing "/"

提交回复
热议问题