Apply from URL - how to basic auth?

I want to
apply from ''
but there is a basic auth enabled, so I get 401. How can I provide credentials?
Thank you.

1 Like

Have you tried putting the credentials in the URL?


Yes, I tried. I.e. if I open in Chrome incognito, it works - file is downloaded immediately, but if put url into gradle file, I see in console that it goes to same url, but gets 401 as usually :
Also password is not smth I would like to be printed out :slight_smile:

Try setting up an Authenticator:

This sets the default Authenticator and will be used in all requests, so be mindful of that.


Authenticator.setDefault (new Authenticator() {
    protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication (aUsername, aPassword.toCharArray());
1 Like

Thank you very much. I understand that it affects all the requests, but currently works for my setup. Still a blank in gradle api, but at least it can be done.