Overview : I'm trying to make an android application for my college email service. Its hosted by Zimbra, Webmail. Im using Jaunt-Api to scrape data from the website.
My question is: I have the link (url) to the attachment. When I open the link using the following code, I get an HTTP 403 error. This means I have to add a basic authentication to this URL. Ive tried for over 6 hours, gone through many such questions on stackoverflow already but couldnt find an answer. How do I add basic authentication to this code?
Intent intent = new Intent(Intent.ACTION_VIEW);
Uri data = Uri.parse(currentemail.attatchment_link);
intent.setData(data);
startActivity(intent);
Otherwise, can anybody suggest a direct way to download the attachment on android? (Given, I have the link, I just need to add the authentication which I have struggled for days now!).
Did you try appending the username and password to the URL itself?
https://gooduser:[email protected]/webcallback?foo=bar