public class LinkedIn extends AbstractOAuth20Service
Modifier and Type | Field and Description |
---|---|
static String |
SCOPE_r_emailaddress
The scope: email address, read only.
|
static String |
SCOPE_r_liteprofile
The scope: basic profile, read only.
|
service, session
Constructor and Description |
---|
LinkedIn() |
LinkedIn(OAuthSession session,
String clientID,
String secret,
String... scopes)
Constructs the service.
|
Modifier and Type | Method and Description |
---|---|
Size |
getApproximateSize()
Gets the approximate size in pixels of the inner browser window requested.
|
JSONObject |
getEmail(String id)
Gets the email address for a LinkedIn profile ID.
|
protected Integer |
getExpiresIn(com.github.scribejava.core.model.OAuth2AccessToken accessToken)
Returns the "expires_in" value from the access token in seconds.
|
JSONObject |
getLiteProfile()
Gets the "light" profile ("r_liteprofile").
|
String |
getServiceName()
Gets the name of the human readable service name, e.g.
|
boolean |
invalidateAccessToken()
Invalidates the access token that may be valid for quite some time.
|
dispose, disposeBlocked, disposeUserCancel, doAuthenticate, getAccessToken
public static final String SCOPE_r_liteprofile
"r_liteprofile" (v2)
"r_basicprofile" (v1), and
"r_fullprofile" (v1).
public static final String SCOPE_r_emailaddress
public LinkedIn(OAuthSession session, String clientID, String secret, String... scopes)
clientID
- The client ID.secret
- The secret.scopes
- The list of scopes as an array, or as one space delimited string.IllegalStateException
- If the authentication engine is not initialized.public LinkedIn()
public String getServiceName()
public Size getApproximateSize()
public JSONObject getLiteProfile() throws IllegalStateException, IOException, JSONException
IllegalStateException
- If the authentication has not completed successfully.IOException
- For I/O errors.JSONException
- For JSON problems.public JSONObject getEmail(String id) throws IllegalStateException, IOException, JSONException
id
- The LinkedIn ID string.IllegalStateException
- If the authentication has not completed successfully.IOException
- For I/O errors.JSONException
- For JSON problems.protected Integer getExpiresIn(com.github.scribejava.core.model.OAuth2AccessToken accessToken)
getExpiresIn
in class AbstractOAuth20Service
accessToken
- The access token.public boolean invalidateAccessToken() throws ExecutionException, InterruptedException, IOException
A service could also provide a sign out or alike.
The last access token is revoked and this might lead to IOException's.
This method just resets the token so it has to be retrieved again and just returns false for failure.
invalidateAccessToken
in class AbstractOAuth20Service
ExecutionException
- For execution errors.InterruptedException
- If the revocation action was interrupted.IOException
- For I/O errors.iizi® is a registered trademark of Mindus SARL. © Copyright Mindus SARL, 2020. All rights reserved.