Use moodle authentication in a external application.

Use moodle authentication in a external application.

by Maduranga Siriwardena -
Number of replies: 1

I want to get the authentication from moodle (say the moodle site from our university) in my android application. I tried to make a http post request from my application with username and password.

But when I execute the post request, I get an exception. This is what I have tried

private URI url = new URI("https://online.mrt.ac.lk/login/index.php");
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(url);
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("username", "user"));
nameValuePairs.add(new BasicNameValuePair("password", "password"));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
InputStream is = entity.getContent();

Please someone help me.

Average of ratings: -
In reply to Maduranga Siriwardena

Re: Use moodle authentication in a external application.

by Maduranga Siriwardena -

The exception what I get is

javax.net.ssl.SSLPeerUnverifiedException: No peer certificate