Smarter LinkedIn oAuth Library

LinkedIn OAuth1 and OAuth2 backend, docs at:

https://python-social-auth.readthedocs.io/en/latest/backends/linkedin.html

class smarter.lib.social_core.backends.linkedin.LinkedinMobileOAuth2(strategy=None, redirect_uri=None)[source]

Bases: LinkedinOAuth2

name = 'linkedin-mobile-oauth2'
user_data_headers(access_token)[source]
class smarter.lib.social_core.backends.linkedin.LinkedinOAuth2(strategy=None, redirect_uri=None)[source]

Bases: BaseOAuth2

ACCESS_TOKEN_METHOD: Literal['GET', 'POST'] = 'POST'
ACCESS_TOKEN_URL = 'https://www.linkedin.com/oauth/v2/accessToken'
AUTHORIZATION_URL = 'https://www.linkedin.com/oauth/v2/authorization'
DEFAULT_SCOPE: list[str] | None = ['openid', 'profile', 'email']
EXTRA_DATA: list[str | tuple[str, str] | tuple[str, str, bool]] | None = [('id', 'id'), ('expires_in', 'expires'), ('firstName', 'first_name'), ('lastName', 'last_name'), ('refresh_token', 'refresh_token'), ('refresh_token_expires_in', 'refresh_expires_in')]
REDIRECT_STATE = False
USER_DETAILS_URL = 'https://api.linkedin.com/v2/userinfo?projection=({projection})'
USER_EMAILS_URL = 'https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~))'
email_data(access_token, *args, **kwargs)[source]
get_user_details(response)[source]

Return user details from Linkedin account

name = 'linkedin-oauth2'
process_error(data)[source]

Process data for errors, raise exception if needed. Call this method on any override of auth_complete.

request_access_token(*args, **kwargs)[source]
user_data(access_token, *args, **kwargs)[source]

Loads user data from service. Implement in subclass

user_data_headers(access_token)[source]
user_details_url()[source]
user_emails_url()[source]
class smarter.lib.social_core.backends.linkedin.LinkedinOpenIdConnect(strategy=None, redirect_uri=None)[source]

Bases: OpenIdConnectAuth

Linkedin OpenID Connect backend. Oauth2 has been deprecated as of August 1, 2023. https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/sign-in-with-linkedin-v2?context=linkedin/consumer/context

OIDC_ENDPOINT: str | None = 'https://www.linkedin.com/oauth'
TOKEN_ENDPOINT_AUTH_METHOD = 'client_secret_post'
name = 'linkedin-openidconnect'
validate_claims(id_token)[source]

Copy of the regular validate_claims method without the nonce validation.