Skip to main content
Improved Formatting; Fixed grammar; Improved usage of tags; Removed thanks/greetings; Improved title;
Source Link
ᔕᖺᘎᕊ
  • 4.4k
  • 2
  • 16
  • 37

Localhost test stackappStack App authentication,get: error 'redirect_uri`'redirect_uri' does not match

I had try as this answertried the Cananswer at "Can the redirect_uri contain port numbernumber"?

But I also get the redirect_uri does not matcham getting the redirect_urifollowing error.:

Provided redirect_uri does not match the redirect_uri this code was created with

My access log looks like:

Provided `redirect_uri` does not match the `redirect_uri` this code was created with

::1 - - [14/Mar/2019:22:49:31 CST] "GET /auth/stackexchange/callback?code=umZowLeAHg*z6Gs*(yIBUg))&state=7a24d06c83edd66415483ce0b32d1bd8714b730215a30e9c HTTP/1.1" 302 9http://localhost:3000/ -> /auth/stackexchange/callback?code=umZowLeAHg*z6Gs(yIBUg))&state=7a24d06c83edd66415483ce0b32d1bd8714b730215a30e9c

Started GET "/auth/failure?message=invalid_credentials&origin=http%3A%2F%2Flocalhost%3A3000%2Fusers%2Fabbc%2Fedit&strategy=stackexchange" for ::1 at 2019-03-14 22:49:50 +0800

::1 - - [14/Mar/2019:22:49:50 CST] "GET /auth/failure?message=invalid_credentials&origin=http%3A%2F%2Flocalhost%3A3000%2Fusers%2Fabbc%2Fedit&strategy=stackexchange HTTP/1.1" 301 88http://localhost:3000/ -> /auth/failuremessage=invalid_credentials&origin=http%3A%2F%2Flocalhost%3A3000%2Fusers%2Fabbc%2Fedit&strategy=stackexchange

I used Rails and my codescode is like this:

gem 'omniauth', '~> 1.9'
gem 'omniauth-oauth2', '~> 1.6'
gem 'omniauth-stackexchange', '~> 0.2.1'

# initializers/omniauth.rb

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :stackexchange, Rails.application.secrets.stack_client_id, Rails.application.secrets.stack_client_secret, public_key: Rails.application.secrets.stack_key, site: 'stackoverflow',callback_url:'http://localhost:3000/'
end

My stackappStack Apps application settings are like this:

OAuth Domain:

localhost

Application Website:

http://localhost:3000/

Stack Apps Post: Not set

Client Side Flow Is Disabled

Desktop OAuth Redirect Uri Is Disabled

  • OAuth Domain: localhost
  • Application Website: http://localhost:3000/
  • Stack Apps Post: Not set
  • Client Side Flow: Disabled
  • Desktop OAuth Redirect Uri: Disabled

These are screenshots of the setting picturessettings on the app's page:

enter image description here

enter image description here

Who can help me How do I fix this? Thanks so much.

Localhost test stackapp authentication,get error 'redirect_uri` does not match

I had try as this answer Can the redirect_uri contain port number?

But I also get the redirect_uri does not match the redirect_uri error.

Provided `redirect_uri` does not match the `redirect_uri` this code was created with

::1 - - [14/Mar/2019:22:49:31 CST] "GET /auth/stackexchange/callback?code=umZowLeAHg*z6Gs*(yIBUg))&state=7a24d06c83edd66415483ce0b32d1bd8714b730215a30e9c HTTP/1.1" 302 9http://localhost:3000/ -> /auth/stackexchange/callback?code=umZowLeAHg*z6Gs(yIBUg))&state=7a24d06c83edd66415483ce0b32d1bd8714b730215a30e9c

Started GET "/auth/failure?message=invalid_credentials&origin=http%3A%2F%2Flocalhost%3A3000%2Fusers%2Fabbc%2Fedit&strategy=stackexchange" for ::1 at 2019-03-14 22:49:50 +0800

::1 - - [14/Mar/2019:22:49:50 CST] "GET /auth/failure?message=invalid_credentials&origin=http%3A%2F%2Flocalhost%3A3000%2Fusers%2Fabbc%2Fedit&strategy=stackexchange HTTP/1.1" 301 88http://localhost:3000/ -> /auth/failuremessage=invalid_credentials&origin=http%3A%2F%2Flocalhost%3A3000%2Fusers%2Fabbc%2Fedit&strategy=stackexchange

I used Rails and my codes like this:

gem 'omniauth', '~> 1.9'
gem 'omniauth-oauth2', '~> 1.6'
gem 'omniauth-stackexchange', '~> 0.2.1'

# initializers/omniauth.rb

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :stackexchange, Rails.application.secrets.stack_client_id, Rails.application.secrets.stack_client_secret, public_key: Rails.application.secrets.stack_key, site: 'stackoverflow',callback_url:'http://localhost:3000/'
end

My stackapp settings like this:

OAuth Domain:

localhost

Application Website:

http://localhost:3000/

Stack Apps Post: Not set

Client Side Flow Is Disabled

Desktop OAuth Redirect Uri Is Disabled

These are the setting pictures:

enter image description here

enter image description here

Who can help me ? Thanks so much.

Localhost test Stack App authentication: error 'redirect_uri' does not match

I tried the answer at "Can the redirect_uri contain port number"?

But I am getting the following error:

Provided redirect_uri does not match the redirect_uri this code was created with

My access log looks like:

::1 - - [14/Mar/2019:22:49:31 CST] "GET /auth/stackexchange/callback?code=umZowLeAHg*z6Gs*(yIBUg))&state=7a24d06c83edd66415483ce0b32d1bd8714b730215a30e9c HTTP/1.1" 302 9http://localhost:3000/ -> /auth/stackexchange/callback?code=umZowLeAHg*z6Gs(yIBUg))&state=7a24d06c83edd66415483ce0b32d1bd8714b730215a30e9c

Started GET "/auth/failure?message=invalid_credentials&origin=http%3A%2F%2Flocalhost%3A3000%2Fusers%2Fabbc%2Fedit&strategy=stackexchange" for ::1 at 2019-03-14 22:49:50 +0800

::1 - - [14/Mar/2019:22:49:50 CST] "GET /auth/failure?message=invalid_credentials&origin=http%3A%2F%2Flocalhost%3A3000%2Fusers%2Fabbc%2Fedit&strategy=stackexchange HTTP/1.1" 301 88http://localhost:3000/ -> /auth/failuremessage=invalid_credentials&origin=http%3A%2F%2Flocalhost%3A3000%2Fusers%2Fabbc%2Fedit&strategy=stackexchange

I used Rails and my code is like this:

gem 'omniauth', '~> 1.9'
gem 'omniauth-oauth2', '~> 1.6'
gem 'omniauth-stackexchange', '~> 0.2.1'

# initializers/omniauth.rb

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :stackexchange, Rails.application.secrets.stack_client_id, Rails.application.secrets.stack_client_secret, public_key: Rails.application.secrets.stack_key, site: 'stackoverflow',callback_url:'http://localhost:3000/'
end

My Stack Apps application settings are like this:

  • OAuth Domain: localhost
  • Application Website: http://localhost:3000/
  • Stack Apps Post: Not set
  • Client Side Flow: Disabled
  • Desktop OAuth Redirect Uri: Disabled

These are screenshots of the settings on the app's page:

enter image description here

enter image description here

How do I fix this?

Source Link

Localhost test stackapp authentication,get error 'redirect_uri` does not match

I had try as this answer Can the redirect_uri contain port number?

But I also get the redirect_uri does not match the redirect_uri error.

Provided `redirect_uri` does not match the `redirect_uri` this code was created with

::1 - - [14/Mar/2019:22:49:31 CST] "GET /auth/stackexchange/callback?code=umZowLeAHg*z6Gs*(yIBUg))&state=7a24d06c83edd66415483ce0b32d1bd8714b730215a30e9c HTTP/1.1" 302 9http://localhost:3000/ -> /auth/stackexchange/callback?code=umZowLeAHg*z6Gs(yIBUg))&state=7a24d06c83edd66415483ce0b32d1bd8714b730215a30e9c

Started GET "/auth/failure?message=invalid_credentials&origin=http%3A%2F%2Flocalhost%3A3000%2Fusers%2Fabbc%2Fedit&strategy=stackexchange" for ::1 at 2019-03-14 22:49:50 +0800

::1 - - [14/Mar/2019:22:49:50 CST] "GET /auth/failure?message=invalid_credentials&origin=http%3A%2F%2Flocalhost%3A3000%2Fusers%2Fabbc%2Fedit&strategy=stackexchange HTTP/1.1" 301 88http://localhost:3000/ -> /auth/failuremessage=invalid_credentials&origin=http%3A%2F%2Flocalhost%3A3000%2Fusers%2Fabbc%2Fedit&strategy=stackexchange

I used Rails and my codes like this:

gem 'omniauth', '~> 1.9'
gem 'omniauth-oauth2', '~> 1.6'
gem 'omniauth-stackexchange', '~> 0.2.1'

# initializers/omniauth.rb

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :stackexchange, Rails.application.secrets.stack_client_id, Rails.application.secrets.stack_client_secret, public_key: Rails.application.secrets.stack_key, site: 'stackoverflow',callback_url:'http://localhost:3000/'
end

My stackapp settings like this:

OAuth Domain:

localhost

Application Website:

http://localhost:3000/

Stack Apps Post: Not set

Client Side Flow Is Disabled

Desktop OAuth Redirect Uri Is Disabled

These are the setting pictures:

enter image description here

enter image description here

Who can help me ? Thanks so much.