Class LinkedIn

java.lang.Object
com.iizix.server.oauth.AbstractOAuthService
com.iizix.server.oauth.services.LinkedIn
All Implemented Interfaces:
IOAuthService

public class LinkedIn extends AbstractOAuthService
The LinkedIn service.
  • Field Details

    • SCOPE_r_liteprofile

      public static final String SCOPE_r_liteprofile
      The scope: basic profile, read only. Today, only "r_liteprofile" is available and is unfortunately very limited.

      "r_liteprofile" (v2)
      "r_basicprofile" (v1), and
      "r_fullprofile" (v1).

      See Also:
    • SCOPE_r_emailaddress

      public static final String SCOPE_r_emailaddress
      The scope: email address, read only.
      See Also:
    • DEFAULT_SCOPES

      public static final String[] DEFAULT_SCOPES
      The default scopes SCOPE_r_liteprofile and SCOPE_r_emailaddress: {"r_emailaddress", "r_liteprofile"}, used when no scope is provided.
  • Constructor Details

    • LinkedIn

      public LinkedIn(OAuthSession session, String clientID, String clientSecret, String... scopes)
      Constructs the service.
      Parameters:
      session - The OAuthSession.
      clientID - The Client ID.
      clientSecret - The Client Secret.
      scopes - The list of scopes as an array, or as one space delimited string. In order to retrieve the user profile information using {@link #getUserProfileInfo()}, you MUST specify the scopes {@link #SCOPE_r_liteprofile} and if you wish to also get the email address, you must also specify the scope {@link #SCOPE_r_emailaddress}.
      Throws:
      NullPointerException - If session, clientID or clientSecret is null.
      IllegalArgumentException - If clientID or clientSecret is empty String.
      IllegalStateException - If the authentication engine is not initialized.
  • Method Details

    • initialize

      public static IServiceCreator<LinkedIn> initialize(String clientID, String clientSecret, String... scopes)
      Creates an instance of the ParamInitializedService that holds the parameters for the provider authentication.
      Parameters:
      clientID - The Client ID.
      clientSecret - The Client Secret.
      scopes - The list of scopes as an array, or as one space delimited string. In order to retrieve the user profile information using {@link #getUserProfileInfo()}, you MUST specify the scopes {@link #SCOPE_r_liteprofile} and if you wish to also get the email address, you must also specify the scope {@link #SCOPE_r_emailaddress}.
      Throws:
      NullPointerException - If clientID, clientSecret or any of the scopes values are null is null.
      IllegalArgumentException - If clientID, clientSecret or any of the scopes values is empty.
    • getAuthenticationProvider

      public AuthenticationProvider getAuthenticationProvider()
      Gets authentication provider.
      Returns:
      The authentication provider enum AuthenticationProvider.LinkedIn.
    • getApproximateSize

      public Size getApproximateSize()
      Gets the approximate size in pixels of the inner browser window requested. This setting used when possible, but is not guaranteed.
      Returns:
      The size, or null if none is known (full screen).
    • getLogoutURL

      public String getLogoutURL()
      Returns the logout URL for the OAuth service. It is not the same as invalidating an access URL.
      Specified by:
      getLogoutURL in class AbstractOAuthService
      Returns:
      The logout URL.
    • getUserProfileInfo

      Gets the UserProfileInfo from this service.

      This will cause the user to have to authenticate with the service, unless not already done.

      All fields available for this service that are possible to set and available will be initialized. Other values will be left null, unknown or undefined.

      Specified by:
      getUserProfileInfo in class AbstractOAuthService
      Returns:
      The UserProfileInfo instance.
      Throws:
      IllegalStateException - If the authentication has not completed successfully, or if the String "profile" is not among the requested scopes.
      ExecutionException - For execution errors.
      InterruptedException - If the revocation action was interrupted.
      IOException - For I/O errors.