public interface AuthProvider
| Modifier and Type | Field and Description |
|---|---|
static String |
COUNTRY |
static String |
DOB |
static String |
EMAIL |
static String |
EXT_NAMESPACE |
static String |
FIRST_NAME |
static String |
FULL_NAME |
static String |
GENDER |
static String |
LANGUAGE |
static String |
LAST_NAME |
static String |
NICK_NAME |
static String |
POSTCODE |
| Modifier and Type | Method and Description |
|---|---|
Response |
api(String url,
String methodType,
Map<String,String> params,
Map<String,String> headerParams,
String body)
Makes OAuth signed HTTP request to a given URL for making any provider
specific calls.
|
AccessGrant |
getAccessGrant()
Retrieves the AccessGrant object.
|
List<Contact> |
getContactList()
Gets the list of contacts of the user and their email.
|
String |
getLoginRedirectURL(String successUrl)
This is the most important action.
|
<T> T |
getPlugin(Class<T> clazz)
Returns the required plugin if provider support that.
|
String |
getProviderId()
Retrieves the provider id
|
Profile |
getUserProfile()
Retrieves the user profile.
|
boolean |
isSupportedPlugin(Class<? extends Plugin> clazz)
Returns True if provider support given plugin otherwise returns False
|
void |
logout()
Logout
|
void |
refreshToken(AccessGrant accessGrant)
Makes a call for a provider to get RefreshToken and returns object of
that provider
|
void |
registerPlugins()
Registers plugin for a provider those are configured in configuration
properties or mentioned in provider implementation.
|
void |
setAccessGrant(AccessGrant accessGrant)
Stores access grant for the provider *
|
void |
setPermission(Permission p) |
Response |
updateStatus(String msg)
Updates the status on the chosen provider if available.
|
Response |
uploadImage(String message,
String fileName,
InputStream inputStream)
Updates the image and message on the chosen provider if available.
|
Profile |
verifyResponse(Map<String,String> requestParams)
Verifies the user when the external provider redirects back to our
application.
|
static final String EXT_NAMESPACE
static final String EMAIL
static final String COUNTRY
static final String LANGUAGE
static final String FULL_NAME
static final String NICK_NAME
static final String DOB
static final String GENDER
static final String POSTCODE
static final String FIRST_NAME
static final String LAST_NAME
String getLoginRedirectURL(String successUrl) throws Exception
ExceptionProfile verifyResponse(Map<String,String> requestParams) throws Exception
requestParams - Request parameters received from the providerExceptionResponse updateStatus(String msg) throws Exception
msg - Message to be shown as user's statusExceptionList<Contact> getContactList() throws Exception
ExceptionProfile getUserProfile() throws Exception
Exceptionvoid logout()
void setPermission(Permission p)
p - Permission object which can be Permission.AUHTHENTICATE_ONLY,
Permission.ALL, Permission.DEFAULTResponse api(String url, String methodType, Map<String,String> params, Map<String,String> headerParams, String body) throws Exception
url - URL to make HTTP request.methodType - Method type can be GET, POST or PUTparams - Any additional parameters whose signature need to compute.
Only used in case of "POST" and "PUT" method type.headerParams - Any additional parameters need to pass as Header Parametersbody - Request BodyExceptionAccessGrant getAccessGrant()
String getProviderId()
void setAccessGrant(AccessGrant accessGrant) throws AccessTokenExpireException, SocialAuthException
accessGrant - It contains the access token and other informationAccessTokenExpireExceptionSocialAuthExceptionResponse uploadImage(String message, String fileName, InputStream inputStream) throws Exception
message - Status MessagefileName - Image file nameinputStream - Input Stream of imageExceptionboolean isSupportedPlugin(Class<? extends Plugin> clazz)
clazz - Fully qualified plugin class name e.g
org.brickred.socialauth.plugin.FeedPlugin.class<T> T getPlugin(Class<T> clazz) throws Exception
clazz - Fully qualified plugin class name e.g
org.brickred.socialauth.plugin.FeedPlugin.classExceptionvoid registerPlugins()
throws Exception
Exceptionvoid refreshToken(AccessGrant accessGrant) throws SocialAuthException
accessGrant - AccessGrant which contains AccessTokenSocialAuthExceptionCopyright © 2018. All Rights Reserved.