53
linuxxx
6y

After a few hours, I think I just got mysql based openvpn authentication working O_o

Fucking yay! Now let's implement a maximum amount of connections per user.

Yes, rants can be happy too.

Comments
  • 1
    How does it work?
  • 4
    @Wombat server config calls an auth bash script which gets a temp file as parameter including the username/password which extracts those and passes it to a php file with the usee/pass as params yet again :).

    User authenticated? exit(0);
    Not authenticated? exit(1);

    Simple but effective :)
  • 0
    @linuxxx not to be the dumb one here but is that how it should be done? Or there are other ways?
  • 2
    @gitpush Deffo not the only way and there are addons but couldn't figure them out and they stored loads of data by default, this solution doesn't store anything other than the amount of active sessions a user has.
  • 2
    @linuxxx thanks for explaining. 😊
  • 1
    @linuxxx aaah I understand thanks man 😀
  • 0
    @linuxxx

    exit(0/1) ???

    I hate that xD But if it works... 🤷‍♂️🤫😇
  • 2
    @xewl It works the same with shell scripts, if it gives an exit 1 the user is not authenticated and if it's exit 0 the user is good to go ;)
  • 2
    @linuxxx I'd expect it the other way around.

    Parsing json/xml is overhead for bash anyway..
  • 2
    @xewl Me too and that was the main bug, returning the wrong exit code for hours 😅

    It just reads a file, hardly any overheat :)
  • 4
    @xewl actually exit status 0 is the convention (at least in C) for success: https://gnu.org/software/libc/...
  • 1
    @Wack Good to know for whenever I would need it.. Reference appreciated!
Add Comment