Displaying Remote PDF via Intent with Basic Auth
I am trying to show a PDF located at http://myserver.com/my_file.pdf . Basic authentication exists for this endpoint. I'm doing it:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://myserver.com/my_file.pdf"));
Bundle bundle = new Bundle();
bundle.putString("Authorization", "Basic xxxxxxxxxxxxxxxxxxxx");
intent.putExtra(Browser.EXTRA_HEADERS, bundle);
startActivity(intent);
But when I debug server side, there is no header in the request Authorization
, so I get 401 Unauthorized.
What am I doing wrong?
0
source to share