Page 1 of 1

auth-user-pass Passfile.txt

Posted: Fri Sep 23, 2022 8:55 am
by DanW
Hi guys I am using openvpn on android I have tried cofig to pull credentials when starting vpn on android using auth-user-pass passfile.txt but for some reason it is not using it and asks me for user and pass. Any Ideas how I can get it to use passfile.txt so when i click on profile i can just connect rather than having to put user and pass in?

Re: auth-user-pass Passfile.txt

Posted: Fri Sep 23, 2022 9:03 am
by openvpn_inc
Hello DanW,

First of all you're on the forum for OpenVPN Connect for Android. That is not the same as Arne Schwabe's OpenVPN for Android app. I can tell you about OpenVPN Connect for Android in this forum post, so I'll assume you're using that and give advice accordingly.

I expect that that feature won't work on Android because that file would have to be stored in the same location as the profile. And in the import process the profile gets moved to another location to secure it, but that additional file won't be. You might be able to have the passfile.txt stored in some other location and change the reference in the openvpn connection profile to that new location... it might work. Probably not due to file permissions and such.

But I think we're on the wrong path here. The auth-user-pass function's goal is to ensure that you don't have to enter username and password to connect. OpenVPN Connect has this already built-in, you don't need auth-user-pass at all to do this. Remove that line from your connection profile, re-import it into the OpenVPN Connect app, and then tap the pencil button to edit the profile's properties, and check the 'save password' button. It will then remember it and you don't have to enter it for subsequent connections.

Hope that helps,
Johan

Re: auth-user-pass Passfile.txt

Posted: Fri Sep 23, 2022 10:14 am
by DanW
Thanks for reply the vpn i am using is built into app the passfile is in same location as ovpn file but it wont use it.

openvpn_inc wrote:
Fri Sep 23, 2022 9:03 am
Hello DanW,

First of all you're on the forum for OpenVPN Connect for Android. That is not the same as Arne Schwabe's OpenVPN for Android app. I can tell you about OpenVPN Connect for Android in this forum post, so I'll assume you're using that and give advice accordingly.

I expect that that feature won't work on Android because that file would have to be stored in the same location as the profile. And in the import process the profile gets moved to another location to secure it, but that additional file won't be. You might be able to have the passfile.txt stored in some other location and change the reference in the openvpn connection profile to that new location... it might work. Probably not due to file permissions and such.

But I think we're on the wrong path here. The auth-user-pass function's goal is to ensure that you don't have to enter username and password to connect. OpenVPN Connect has this already built-in, you don't need auth-user-pass at all to do this. Remove that line from your connection profile, re-import it into the OpenVPN Connect app, and then tap the pencil button to edit the profile's properties, and check the 'save password' button. It will then remember it and you don't have to enter it for subsequent connections.

Hope that helps,
Johan

Re: auth-user-pass Passfile.txt

Posted: Fri Sep 23, 2022 1:06 pm
by openvpn_inc
Hello DanW,

If this is neither Arne's app nor our OpenVPN Connect app, then I'm afraid I have no solution for you. You'll then have to see if you can get the file in the same location as the connection profile and hope that it is able to read it. If it doesn't, well, there's some hope for you yet - there's a patch in review at the moment for OpenVPN2 codebase that allows specifying auth-user-pass in this fashion:

<auth-user-pass>
username_goes_here
password_goes_here
</auth-user-pass>

Which would allow to embed the data into the connection profile itself instead of referencing an external file. But that doesn't help you now, because this is not yet implemented.

Have a nice day,
Johan