Class LinkedIn2ProfileCreator

java.lang.Object
org.pac4j.oauth.profile.creator.OAuth20ProfileCreator
org.pac4j.oauth.profile.linkedin2.LinkedIn2ProfileCreator
All Implemented Interfaces:
org.pac4j.core.profile.creator.ProfileCreator

public class LinkedIn2ProfileCreator extends OAuth20ProfileCreator
A specific LinkedIn2 profile creator.
Since:
3.8.0
Author:
Jerome Leleu, Vassilis Virvilis
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.pac4j.core.client.IndirectClient
     
     
    protected final org.slf4j.Logger
     
    protected static final com.fasterxml.jackson.databind.ObjectMapper
    Constant mapper
  • Constructor Summary

    Constructors
    Constructor
    Description
    LinkedIn2ProfileCreator(OAuth20Configuration configuration, org.pac4j.core.client.IndirectClient client)
    Constructor for LinkedIn2ProfileCreator.
  • Method Summary

    Modifier and Type
    Method
    Description
    Optional<org.pac4j.core.profile.UserProfile>
    create(org.pac4j.core.context.CallContext ctx, org.pac4j.core.credentials.Credentials credentials)
    protected com.github.scribejava.core.model.OAuthRequest
    createOAuthRequest(String url, com.github.scribejava.core.model.Verb verb)
    Create an OAuth request.
    protected Optional<org.pac4j.core.profile.UserProfile>
    retrieveUserProfileFromToken(org.pac4j.core.context.WebContext context, com.github.scribejava.core.model.Token accessToken)
    Retrieve the user profile from the access token.
    protected String
    sendRequestForData(com.github.scribejava.core.oauth.OAuthService service, com.github.scribejava.core.model.Token accessToken, String dataUrl, com.github.scribejava.core.model.Verb verb)
    Make a request to get the data of the authenticated user for the provider.

    Methods inherited from class org.pac4j.oauth.profile.creator.OAuth20ProfileCreator

    addTokenToProfile, getAccessToken, signRequest

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • logger

      protected final org.slf4j.Logger logger
    • mapper

      protected static final com.fasterxml.jackson.databind.ObjectMapper mapper
      Constant mapper
    • configuration

      protected OAuthConfiguration configuration
    • client

      protected org.pac4j.core.client.IndirectClient client
  • Constructor Details

    • LinkedIn2ProfileCreator

      public LinkedIn2ProfileCreator(OAuth20Configuration configuration, org.pac4j.core.client.IndirectClient client)

      Constructor for LinkedIn2ProfileCreator.

      Parameters:
      configuration - a OAuth20Configuration object
      client - a IndirectClient object
  • Method Details

    • retrieveUserProfileFromToken

      protected Optional<org.pac4j.core.profile.UserProfile> retrieveUserProfileFromToken(org.pac4j.core.context.WebContext context, com.github.scribejava.core.model.Token accessToken)
      Retrieve the user profile from the access token.
      Parameters:
      context - the web context
      accessToken - the access token
      Returns:
      the user profile
    • create

      public Optional<org.pac4j.core.profile.UserProfile> create(org.pac4j.core.context.CallContext ctx, org.pac4j.core.credentials.Credentials credentials)
      Specified by:
      create in interface org.pac4j.core.profile.creator.ProfileCreator
    • sendRequestForData

      protected String sendRequestForData(com.github.scribejava.core.oauth.OAuthService service, com.github.scribejava.core.model.Token accessToken, String dataUrl, com.github.scribejava.core.model.Verb verb)
      Make a request to get the data of the authenticated user for the provider.
      Parameters:
      service - the OAuth service
      accessToken - the access token
      dataUrl - url of the data
      verb - method used to request data
      Returns:
      the user data response
    • createOAuthRequest

      protected com.github.scribejava.core.model.OAuthRequest createOAuthRequest(String url, com.github.scribejava.core.model.Verb verb)
      Create an OAuth request.
      Parameters:
      url - the url to call
      verb - method used to create the request
      Returns:
      the request