Closed johns10 closed 1 year ago
You should use Sign In with LinkedIn v2
. Sign In with LinkedIn v1
is an OAuth 2.0 strategy, but the LinkedIn stategy is using OIDC. Linkedin conflates the two so this kinda works. I'll make a stronger note in the module doc.
The docs have been updated: https://github.com/pow-auth/assent/blob/main/lib/assent/strategies/linkedin.ex
I did some more work on this before it actually worked. Here's how I made it work in my app:
defmodule Savr.LinkedinStrategy do
use Assent.Strategy.OAuth2.Base
@impl true
def default_config(_config) do
[
site: "https://www.linkedin.com",
authorize_url: "https://www.linkedin.com/oauth/v2/authorization",
token_url: "https://www.linkedin.com/oauth/v2/accessToken",
user_url: "https://api.linkedin.com/v2/me",
authorization_params: [scope: "r_emailaddress r_liteprofile"],
auth_method: :client_secret_post
]
end
@impl true
def normalize(_config, user) do
{:ok,
%{
"sub" => user["id"],
"name" => user["localizedFirstName"] <> user["localizedLastName"],
"email" => user["email"]
}}
end
end
I will go and try what you've recommended now. Their auth seems like a bit of a cluster ****
Hot dang dude, first time through!! This knowledge would have saved my client about $300 hahaaa
The module I posted above works for the V1 auth, in case anyone ever cares.
This strategy didn't work. I had to make a custom strategy with these configs.