
I recently started playing a lot with Proxmox hosts. Most folks know I am a fan of Cloudflare Tunnels as well. Seeing these are externally available via tunnels as well as CloudFlare Zero Trust Access, I wanted to add OpenID Connect directly to the Proxmox web login for my Google Workspace account. This same account is used with CloudFlare Access, so in effect I do have to log in twice, but the credentials, SSO, and subsequent MFA/Passkey are the same. The first connection authenticates me to CloudFlare Zero Trust to get to the web UI and the second is the host login itself. This provides a layer of authentication that suits my needs. Below you will see how to set it up and it turned out to be very easy.
In Google Cloud Console
For Creating Credentials
- Head to https://console.cloud.google.com/ and log in with the account you want to use for google auth
- In the pulldown at the top to the right of “Google Cloud” create a new one such as “Proxmox Auth”
- Select “API & Services” from Quick Access or the sandwich menu on the upper left
- Select “Credentials” and click “+ Create Credentials” and select “OAuth Client ID”
- For application type, select “Web Application” and give it a helpful name (see below if it asks you for a consent screen)
- For Authorized Javascript Origins, you’ll want to enter your full hostname with FQDN for Proxmox, e.g. https://proxmox.domain.com
- These would be your external URL’s in Cloudflare Tunnels
- For Authorized redirect URIs, enter the page you actually access for Proxmox e.g. https://proxmox.domain.com
- These would be your external URL’s in Cloudflare Tunnels
- Save.
- A window will pop up with a Client ID and Client Secret. Not to worry you can come back for these later.
For Oauth Consent Screen
- If at any point above you’re asked to create a consent screen, go ahead and click “Configure Consent Screen”
- Generally this only happens if you’ve come to the credentials page again after the first time.
- Select the type of access. Internal means restricted to the workspace domain you’re currently using. (This is what I use to shrink the pool of potential logins). Click “Create“
- Add an app name, pick an existing email for support, add a logo if you want.
- Add your host+FQDN as above (e.g. https://proxmox.domain.com) to App Domain
- you can leave the privacy policy and TOS links blank.
- Add your Authorized Domains. These must match the workspace account from which you’re logging in. These will likely autofill from your earlier domain entries.
- Add a developer email and click “Save and Continue“
For Scopes
- Click Data Access
- Click Add or Remove Scopes
- Add these to “Non-sensitive scopes”:
- ./auth/userinfo/.profile
- ./auth/userinfo/.email
- openid
- Select the checkboxes for the above scopes and click “Update“
- click “Save and Continue”
- Review the summary and click “Back to Dashboard“
In Proxmox
- Click on Datacenter in the tree
- Scroll down to Permissions, expand that subtree, and click Realms
- Click “Add” and select OpenID Connect Server
- Add the Issuer URL of https://accounts.google.com
- In the “Realm:” field, add something like “GoogleAuth” (You see this later when adding users)
- Paste the Client ID and Client Key (aka Client secret) from the Google credentials page.
- Do not check “autocreate users“
- Select Username Claim of “email”
- For Scopes enter “email profile openid” (leaving spaces between scopes)
- For Prompt select “login”
- Select if you want this realm to be default and enter a useful comment.
- Leave ACR Values blank
- Click Add.
Adding users in Proxmox
- Under the permissions subtree, select Users
- Click Add
- For the User Name enter the workspace account email address (e.g. [email protected] where the domain is the one setup above in google)
- Add the user to any groups and add any metadata you like here.
- Add the same email to the email field.
- Proxmox will append “@<realmname>” to the username so it may look like [email protected]@GoogleAuth
- click Add
Groups and permissions
- I added my primary google auth user as an admin. You can probably find better guides for this but in short:
- Click on Permissions
- Click Add, then User Permission
- For Path click /
- User: your new google auth [email protected]@googleauth
- Select a Role (e.g. Administrator)
- Click Add
Chris Colotti's Blog Thoughts and Theories About…