wg-access-server
Sign in to the wg-access-server WireGuard VPN server with Pocket ID.
wg-access-server supports OIDC out of the box.
Create the client in Pocket ID
Section titled “Create the client in Pocket ID”- In Pocket ID, open Administration → OIDC Clients and click Add OIDC Client.
- Enter a name such as
wg-access-serverand add the callback URLhttps://wg.example.com/callback. - Click Create and copy the Client ID and the Client secret. The client secret is only shown once.
- On the client’s Access tab, select the groups that may sign in under Allowed User Groups, or choose All Users.
Configure wg-access-server
Section titled “Configure wg-access-server”- Open the
config.yamlused by the server. - Create an
authsection with anoidcsubsection. - Enter the values as follows:
auth:oidc:# Can be anything you likename: Pocket-ID# Should point to the domain you are hosting Pocket-ID onissuer: https://id.example.com# ID and Secret provided by Pocket-IDclientID: <client-id>clientSecret: <client-secret># Callback URL you entered in Pocket-IDredirectURL: https://wg.example.com/callback# List of scopes to request claims for.# Must include at least 'openid'.scopes:- openid- profile- email- groups
For further reference, consult the upstream documentation.
Managing privileges
Section titled “Managing privileges”You can map groups of users that are allowed to access wg-access-server and define a group of users with admin privileges.
For example, when using LLDAP as a backend for Pocket ID, all LLDAP administrators (members of the group lldap_admin) can also be granted administrative privileges in wg-access-server with this claim mapping:
auth: oidc: # ... claimMapping: admin: "'lldap_admin' in groups"Note that you need to enable the groups scope in the configuration.
Restricting email domains
Section titled “Restricting email domains”wg-access-server can optionally restrict user access to specific email domains:
auth: oidc: # ... emailDomains: - example.comNote that you need to enable the email scope in the configuration.