Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Username UNDEF if not using client-certs #139

Closed
andreas-p opened this issue Feb 5, 2024 · 2 comments
Closed

Username UNDEF if not using client-certs #139

andreas-p opened this issue Feb 5, 2024 · 2 comments
Labels
✨ enhancement New feature or request keep

Comments

@andreas-p
Copy link

Problem Statement

By initial motivation (https://medium.com/@jkroepke/openvpn-sso-via-oauth2-ab2583ee8477), this manager should make using client certificates for openvpn authentication unneeded. Actually, openvpn/openvpn-auth-oauth2 works fine with verify-client-cert none, but the status file will state "UNDEF" as user, and consequently ipp.txt won't help to re-use IP addresses when the same user reconnects.
Current, client certificates and verify-client-cert required/optional is necessary to obtain the username in openvpn.

Proposed Solution

openvpn-auth-oauth2 should report the username back to openvpn, so that openvpn-status and ipp.txt can work as expected.
Preferrably, the username should be taken from the OAuth2 claims. For this, I propose a setting oauth2.userclaim, to specify where to take the username from (might be one of e.g. preferred_username, email, name).

Additional information

No response

Acceptance Criteria

No response

@andreas-p andreas-p added the ✨ enhancement New feature or request label Feb 5, 2024
@andreas-p andreas-p changed the title Username UDEF if not using client-certs Username UNDEF if not using client-certs Feb 5, 2024
@jkroepke
Copy link
Owner

jkroepke commented Feb 5, 2024

openvpn-auth-oauth2 should report the username back to openvpn

The OpenVPN server itself can't override the common name from a client. And there is no away that openvpn-auth-oauth2 can report the username back.

See: OpenVPN/openvpn#299

Once implement in OpenVPN server, I will implement it soon. You may can leave a comment there.


There is a command in OpenVPN called auth-token-user, which is only used in context of auth-token. While its implemented, auth-token is only used, if the initial sessions contains username/password and the value of auth-token-user is not used on ipp.txt file.

See: OpenVPN/openvpn#296

@jkroepke
Copy link
Owner

jkroepke commented Feb 28, 2024

FYI: I have written a request for help issue here: #202

If you know people with c knowledge, let them know.

I would also close the issue in favor of #202

@jkroepke jkroepke closed this as not planned Won't fix, can't repro, duplicate, stale Feb 28, 2024
@jkroepke jkroepke unpinned this issue Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request keep
Projects
None yet
Development

No branches or pull requests

2 participants