Skip to content

v1.0.1 breaks existing integrationΒ #76

@Deradon

Description

@Deradon

Heads-Up: I'll provide more information later.

Issue

We've upgraded omniauth-linkedin-oauth2 to v1.0.1. yesterday and since then have not received successful sign-ins/sign-ups anymore via LinkedIn.

Relevant Stacktrace

OAuth2::Error: invalid_request: Duplicate values defined for "client_secret" parameter
{"error":"invalid_request","error_description":"Duplicate values defined for \"client_secret\" parameter"}

File "/app/vendor/bundle/ruby/3.2.0/gems/oauth2-1.4.11/lib/oauth2/client.rb" line 139 in request
File "/app/vendor/bundle/ruby/3.2.0/gems/oauth2-1.4.11/lib/oauth2/client.rb" line 177 in get_token
File "/app/vendor/bundle/ruby/3.2.0/gems/oauth2-1.4.11/lib/oauth2/strategy/auth_code.rb" line 32 in get_token
File "/app/vendor/bundle/ruby/3.2.0/gems/omniauth-oauth2-1.7.3/lib/omniauth/strategies/oauth2.rb" line 126 in build_access_token
File "/app/vendor/bundle/ruby/3.2.0/gems/omniauth-oauth2-1.7.3/lib/omniauth/strategies/oauth2.rb" line 91 in callback_phase
File "/app/vendor/bundle/ruby/3.2.0/gems/omniauth-2.1.1/lib/omniauth/strategy.rb" line 272 in callback_call
File "/app/vendor/bundle/ruby/3.2.0/gems/omniauth-2.1.1/lib/omniauth/strategy.rb" line 194 in call!
File "/app/vendor/bundle/ruby/3.2.0/gems/omniauth-2.1.1/lib/omniauth/strategy.rb" line 169 in call
File "/app/vendor/bundle/ruby/3.2.0/gems/omniauth-2.1.1/lib/omniauth/builder.rb" line 44 in call
File "/app/vendor/bundle/ruby/3.2.0/gems/actionpack-7.0.7/lib/action_dispatch/middleware/stack.rb" line 61 in block in call
# ... lots of rails logs
File "/app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.7/lib/rails/engine.rb" line 530 in call
File "/app/vendor/bundle/ruby/3.2.0/gems/puma-6.3.1/lib/puma/configuration.rb" line 270 in call
File "/app/vendor/bundle/ruby/3.2.0/gems/puma-6.3.1/lib/puma/request.rb" line 100 in block in handle_request
File "/app/vendor/bundle/ruby/3.2.0/gems/puma-6.3.1/lib/puma/thread_pool.rb" line 344 in with_force_shutdown
File "/app/vendor/bundle/ruby/3.2.0/gems/puma-6.3.1/lib/puma/request.rb" line 99 in handle_request
File "/app/vendor/bundle/ruby/3.2.0/gems/puma-6.3.1/lib/puma/server.rb" line 443 in process_client
File "/app/vendor/bundle/ruby/3.2.0/gems/puma-6.3.1/lib/puma/server.rb" line 245 in block in run
File "/app/vendor/bundle/ruby/3.2.0/gems/puma-6.3.1/lib/puma/thread_pool.rb" line 151 in block in spawn_thread
AbstractController::ActionNotFound: Could not find devise mapping for path "/users/auth/linkedin/callback?code=<REDACTED>&state=<REDACTED>".
This may happen for two reasons:

1) You forgot to wrap your route inside the scope block. For example:

devise_scope :user do
get "/some/route" => "some_devise_controller"
end

2) You are testing a Devise controller bypassing the router.
If so, you can explicitly tell Devise which mapping to use:

@request.env["devise.mapping"] = Devise.mappings[:user]

Links

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions