Replies: 2 comments 3 replies
-
Just to be clear, you're getting the error about a missing You could verify that omniauth_setup do
p omniauth_strategy.options["client_secret"]
end I'm assuming it will be |
Beta Was this translation helpful? Give feedback.
-
It looks like after doing some digging, this error stems from the The fix for me was to add an initializer in module OmniAuth
module Strategies
class LinkedIn < OmniAuth::Strategies::OAuth2
def token_params
super.tap do |params|
params.client_secret = options.client_secret
end
end
end
end
end Thanks for the debugging help Janko! I may have more questions about this new gem, but I'll leave them for another discussion. You're the best! |
Beta Was this translation helpful? Give feedback.
-
Hey @janko! Thanks for the great library. I started this conversation in
rodauth-rails
before finding this gem shortly after. I am trying to get this working with LinkedIn Omniauth, and would love some help! I created two local repositories - a NextJS application, and a Rodauth Rails app.Resources
My Use Cases
I want to use Rodauth as an API Only Rails app that does the following:
1.) Allows me to get user information from LinkedIn
2.) Allows me to create accounts from LinkedIn
3.) Allows me to let users who have previously created an account with their LinkedIn Credentials to log in
4.) Allows me to persist login
What I've Tried
I have made a client app, that creates an authorization URL, following the spec of the LinkedIn API.
Then, I created a Rodauth app. I followed the README in
rodauth-rails
for a JSON API. I also added a cookie store. I then added therodauth-omniauth
gem, in addition to theomniauth-linkedin-2
gem, following all steps of the README in this repository.You can find my backend app here.
I made a POST request to my backend app at
auth/linkedin
, which returns an authorization URL. The response looks like:Which I then open in a new tab from my client.
However, that page gives me an error:
It says that the client secret is missing. I do specifiy that in the
omniauth_provider
inrodauth_main
here (I replaced my personal secret for security reasons in this Github repo). Here is what the log looks like:Beta Was this translation helpful? Give feedback.
All reactions