|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.feedhenry.sdk.FHRemote
com.feedhenry.sdk.api.FHAuthRequest
public class FHAuthRequest
The request for calling the authentication function. Example:
FHAuthRequest authRequest = FH.buildAuthRequest();
// This is an oAuth auth policy. Setting a presenting activity will allow the library to automatically handle the interaction between the user and the oAuth provider.
// You also need to add the following code to your application's AndroidManifest.xml file (inside the <application> element):
// <activity android:name="com.feedhenry.sdk.oauth.FHOAuthIntent" />;
authRequest.setPresentingActivity(this);
authRequest.setAuthPolicyId("MyGooglePolicy");
authRequest.executeAsync(new FHActCallback() {
public void success(FHResponse resp) {
Log.d("FHAuthActivity", "user sessionToken = "+ resp.getJson().getString("sessionToken"));
}
public void fail(FHResponse resp) {
Log.d("FHAuthActivity", resp.getErrorMessage());
}
});
Field Summary | |
---|---|
protected static java.lang.String |
LOG_TAG
|
Fields inherited from class com.feedhenry.sdk.FHRemote |
---|
mCallback, mContext, mProperties, mUDID, PATH_PREFIX |
Constructor Summary | |
---|---|
FHAuthRequest(android.content.Context context,
java.util.Properties pProps)
Constructor |
Method Summary | |
---|---|
protected org.apache.http.Header[] |
buildHeaders(org.apache.http.Header[] pHeaders)
|
void |
executeAsync(FHActCallback pCallback)
Execute the request asynchronously. |
protected java.lang.String |
getPath()
|
protected JSONObject |
getRequestArgs()
|
void |
setAuthPolicyId(java.lang.String pPolicyId)
Set the policy id for this auth request |
void |
setAuthUser(java.lang.String pPolicyId,
java.lang.String pUserName,
java.lang.String pPassword)
Set the user name for the auth request. |
void |
setPresentingActivity(android.content.Context pActivity)
If the auth policy type is OAuth, user need to enter their username and password for the OAuth provider. |
Methods inherited from class com.feedhenry.sdk.FHRemote |
---|
executeAsync, getApiURl, setCallback, setUDID |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static java.lang.String LOG_TAG
Constructor Detail |
---|
public FHAuthRequest(android.content.Context context, java.util.Properties pProps)
pProps
- the app configurationsMethod Detail |
---|
public void setAuthPolicyId(java.lang.String pPolicyId)
pPolicyId
- the auth policy id. It is required for all the auth requestspublic void setAuthUser(java.lang.String pPolicyId, java.lang.String pUserName, java.lang.String pPassword)
pPolicyId
- the auth policy idpUserName
- the user namepPassword
- the passwordprotected java.lang.String getPath()
getPath
in class FHRemote
protected JSONObject getRequestArgs()
getRequestArgs
in class FHRemote
public void setPresentingActivity(android.content.Context pActivity)
pActivity
- the parent Activity instance to invoke the WebViewpublic void executeAsync(FHActCallback pCallback) throws java.lang.Exception
FHAct
executeAsync
in interface FHAct
executeAsync
in class FHRemote
pCallback
- the callback function
java.lang.Exception
protected org.apache.http.Header[] buildHeaders(org.apache.http.Header[] pHeaders) throws java.lang.Exception
buildHeaders
in class FHRemote
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |