I have already implemented a restfull web service for Android. Now what i want to do is to implement the log-in authentication part using kerberos. I'm a completely newbee to kerberos (I do have the basic understanding as to what happens).
My login activity async task code is as follows.
protected class AsyncLogin extends AsyncTask {
String userName=null;
@Override
protected Boolean doInBackground(String... params) {
RestAPI api = new RestAPI();
boolean userAuth = false;
try {
// Call the User Authentication Method in API
JSONObject jsonObj = api.UserAuthentication(params[0],
params[1],params[2]);
//Parse the JSON Object to boolean
JSONParser parser = new JSONParser();
userAuth = parser.parseUserAuth(jsonObj);
userName=params[0];
} catch (Exception e) {
// TODO Auto-generated catch block
Log.d("AsyncLogin", e.getMessage());
}
return userAuth;
}
@Override
protected void onPreExecute() {
super.onPreExecute();
Toast.makeText(context, "Please Wait...",Toast.LENGTH_SHORT).show();
}
@Override
protected void onPostExecute(Boolean result) {
// TODO Auto-generated method stub
//Check user validity
if (result) {
Toast.makeText(context, " Valid username/password ",Toast.LENGTH_SHORT).show();
Intent i = new Intent(LoginActivity.this,
Connecting_interface.class);
i.putExtra("username",userName);
startActivity(i);
}
else
{
Toast.makeText(context, "Not valid username/password ",Toast.LENGTH_SHORT).show();
}
}
}
How can i implement kerberos into this ?? Please help me
Your valued help is much appreciated. Thanks & Regards
0 comments:
Post a Comment