Yes, this is one endorsed way. We should investigate though why you don't get the authentication dialog known from Windows and Android. Please for the love of god, make it so we have the option to save our credentials when logging in to a HTTP server. It's extremely irritating if one uses it a lot.