implementing login against myexperiment
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/commit/22e8de5d Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/tree/22e8de5d Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/diff/22e8de5d Branch: refs/heads/master Commit: 22e8de5d102ff35542e444ad6039b0ef3dfd9e89 Parents: 1c32531 Author: larrytech7 <larrya...@gmail.com> Authored: Mon Jul 20 22:08:30 2015 +0100 Committer: larrytech7 <larrya...@gmail.com> Committed: Mon Jul 20 22:08:30 2015 +0100 ---------------------------------------------------------------------- .../taverna/mobile/activities/LoginActivity.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/22e8de5d/app/src/main/java/org/apache/taverna/mobile/activities/LoginActivity.java ---------------------------------------------------------------------- diff --git a/app/src/main/java/org/apache/taverna/mobile/activities/LoginActivity.java b/app/src/main/java/org/apache/taverna/mobile/activities/LoginActivity.java index 3e8466a..7048554 100644 --- a/app/src/main/java/org/apache/taverna/mobile/activities/LoginActivity.java +++ b/app/src/main/java/org/apache/taverna/mobile/activities/LoginActivity.java @@ -172,13 +172,26 @@ public class LoginActivity extends ActionBarActivity { String authentication = userName + ":" + password; con.setRequestMethod("GET"); con.setRequestProperty("Authorization", "Basic " + Base64.encodeToString(authentication.getBytes(), Base64.DEFAULT)); + con.setInstanceFollowRedirects(true); con.connect(); response = String.valueOf(con.getResponseCode()); //response values are: //401 for an unauthorized or invalid credential and 200 for a valid and authorized user + System.out.println("url = "+con.getURL()); + System.out.println("content-type = "+con.getContentType()); + System.out.println("content encoding "+con.getContentEncoding()); + System.out.println("date"+con.getDate()); System.out.println("" + response); System.out.println(""+con.getResponseMessage()); + BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream())); + StringBuilder sb = new StringBuilder(); + String s = ""; + while((s = br.readLine())!= null ){ + sb.append(s); + } + System.out.println("data: "+sb.toString()); + con.disconnect(); return response; @@ -193,7 +206,6 @@ public class LoginActivity extends ActionBarActivity { @Override protected void onPostExecute(String response) { - Log.i("STATUS CODE", ""+response); pd.dismiss(); if(response != null) { switch(Integer.parseInt(response)){