It's been a while since I set this up, but I will do my best to give the best information I can remember:
The basic instructions are here:
https://support.google.com/cloud/answer/6158849?hl=en for reference.
For proxmox users:
https://pve.proxmox.com/wiki/User_Management
Do not enter the quotes in the text fields.
Using Google Auth with Proxmox
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" select an existing project or create a new one (e.g. "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
- For Authorized redirect URIs, enter the page you accually access for Proxmox with port, e.g. https://proxmox.domain.com:8006
- Save.
- A window will pop up with a Client ID and Client Secret. You can always come back to these from the Credentails page by clicking on the name you entered above.
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 Add or Remove Scopes
- I made some guesses here. I added these to "Non-sensitive scopes":
- ./auth/userinfo/.profile
- ./auth/userinfo/.email
- openid
- Select the checkboxes for the above scopes and click "Update" in the modal window.
- I did not add anything to sensitive / restricted scopes.
- click "Save and Continue"
- Review the summary and click "Back to Dashboard"
- I don't think an "Internal" OAuth Consent will request a verification check so I won't cover that here.
In Proxmox
Initial Setup for Auth
- 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. user@domain.com where the domain is the one setup above in google)
- Add the user to any groups and add any metadata you like here. You probably want to add the same email to the email field.
- Proxmox will append "@<realmname>" to the username so it may look like user@domain.com@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 user@domain.com@googleauth
- Select a Role (e.g. Administrator)
- Click Add
I think that's it. Once you log out, you should be able to log back in with google.
Note that since you are not logging in as root, you have a few limited permissions--I don't think you can perform system updates for example.