Class: Auth::LinkedInOidcAuthenticator
- Inherits:
-
ManagedAuthenticator
- Object
- Authenticator
- ManagedAuthenticator
- Auth::LinkedInOidcAuthenticator
- Defined in:
- lib/auth/linkedin_oidc_authenticator.rb
Defined Under Namespace
Classes: LinkedInOidc
Instance Method Summary collapse
- #enabled? ⇒ Boolean
- #name ⇒ Object
-
#primary_email_verified?(_auth_token) ⇒ Boolean
LinkedIn doesn’t let users login to websites unless they verify their e-mail address, so whatever e-mail we get from LinkedIn must be verified.
- #register_middleware(omniauth) ⇒ Object
Methods inherited from ManagedAuthenticator
#after_authenticate, #after_create_account, #always_update_user_email?, #can_connect_existing_user?, #can_revoke?, #description_for_auth_hash, #description_for_user, #find_user_by_email, #find_user_by_username, #is_managed?, #match_by_email, #match_by_username, #retrieve_avatar, #retrieve_profile, #revoke
Methods inherited from Authenticator
#after_authenticate, #after_create_account, #can_connect_existing_user?, #can_revoke?, #description_for_auth_hash, #description_for_user, #provides_groups?, #revoke
Instance Method Details
#enabled? ⇒ Boolean
48 49 50 |
# File 'lib/auth/linkedin_oidc_authenticator.rb', line 48 def enabled? SiteSetting.enable_linkedin_oidc_logins end |
#name ⇒ Object
44 45 46 |
# File 'lib/auth/linkedin_oidc_authenticator.rb', line 44 def name "linkedin_oidc" end |
#primary_email_verified?(_auth_token) ⇒ Boolean
LinkedIn doesn’t let users login to websites unless they verify their e-mail address, so whatever e-mail we get from LinkedIn must be verified.
64 65 66 |
# File 'lib/auth/linkedin_oidc_authenticator.rb', line 64 def primary_email_verified?(_auth_token) true end |
#register_middleware(omniauth) ⇒ Object
52 53 54 55 56 57 58 59 60 |
# File 'lib/auth/linkedin_oidc_authenticator.rb', line 52 def register_middleware(omniauth) omniauth.provider LinkedInOidc, setup: lambda { |env| strategy = env["omniauth.strategy"] strategy.[:client_id] = SiteSetting.linkedin_oidc_client_id strategy.[:client_secret] = SiteSetting.linkedin_oidc_client_secret } end |