Keycloak latest with PVE 7.4-3

a.bavinov

New Member
Jul 2, 2022
4
0
1
Hello community, maybe some one can help me solve this issue.
I have a PVE server with configured openID realm
Code:
~# cat /etc/pve/domains.cfg
pve: pve
        comment Proxmox VE authentication server

pam: pam
        comment Linux PAM standard authentication

openid: [redacted]
        client-id [redacted]
        issuer-url https://auth.[redacted]/auth/realms/[redacted]
        client-key [redacted]
        default 0
        username-claim username

And configured new realm and client on the keycloak v21 side:
Code:
Client ID: [redacted]
Name: [redacted]
Description: empty
Enabled: ON
Always Display in Console: OFF
Consent Required: ON
Display Client On Consent Screen: OFF
Client Protocol: openid-connect
Access Type: confidential
Standard Flow Enabled: ON
Implicit Flow Enabled: ON
Direct Access Grants Enabled: ON
Service Accounts Enabled: OFF
OAuth 2.0 Device Authorization Grant Enabled: OFF
Authorization Enabled: OFF
Root URL: empty
Valid Redirect URIs: https://[redacted]
Base URL: empty
Admin URL: empty
Web Origins: empty
Backchannel Logout URL: empty
Backchannel Logout Session Required: OFF
Backchannel Logout Revoke Offline Sessions: OFF


I create a user on the keycloak side in my realm. But when I tried to log in through this openid realm I got this error

OpenID redirect failed. Request failed (500)

By the way, when I tried to curl my openID url, I got this:
~# curl https://auth.[redacted]/auth/realms/[redacted] {"error":"RESTEASY003210: Could not find resource for full path: https://auth.[redacted]/auth/realms/[redacted]"}

Any help would be very helpful, thank you in advance)
 
Have you created the users on the PVE-side? I don't know it this is still necessary, but previously you needed to also set autocreate 1. Just for reference, two other threads on the forums about keycloak are this and this.
 
Have you created the users on the PVE-side? I don't know it this is still necessary, but previously you needed to also set autocreate 1. Just for reference, two other threads on the forums about keycloak are this and this.
I enabled auto-create users when creating a realm for openID on PVE side, so I think the problem was not in that.
 
Well, I have overcome this problem, maybe you can give me a last clue. How to make an automatic group assignment on the PVE side for a user who logged in via Keycloak and was created on the PVE side
 
Hello community, maybe some one can help me solve this issue.
I have a PVE server with configured openID realm
Code:
~# cat /etc/pve/domains.cfg
pve: pve
        comment Proxmox VE authentication server

pam: pam
        comment Linux PAM standard authentication

openid: [redacted]
        client-id [redacted]
        issuer-url https://auth.[redacted]/auth/realms/[redacted]
        client-key [redacted]
        default 0
        username-claim username

And configured new realm and client on the keycloak v21 side:
Code:
Client ID: [redacted]
Name: [redacted]
Description: empty
Enabled: ON
Always Display in Console: OFF
Consent Required: ON
Display Client On Consent Screen: OFF
Client Protocol: openid-connect
Access Type: confidential
Standard Flow Enabled: ON
Implicit Flow Enabled: ON
Direct Access Grants Enabled: ON
Service Accounts Enabled: OFF
OAuth 2.0 Device Authorization Grant Enabled: OFF
Authorization Enabled: OFF
Root URL: empty
Valid Redirect URIs: https://[redacted]
Base URL: empty
Admin URL: empty
Web Origins: empty
Backchannel Logout URL: empty
Backchannel Logout Session Required: OFF
Backchannel Logout Revoke Offline Sessions: OFF


I create a user on the keycloak side in my realm. But when I tried to log in through this openid realm I got this error

OpenID redirect failed. Request failed (500)

By the way, when I tried to curl my openID url, I got this:
~# curl https://auth.[redacted]/auth/realms/[redacted] {"error":"RESTEASY003210: Could not find resource for full path: https://auth.[redacted]/auth/realms/[redacted]"}

Any help would be very helpful, thank you in advance)
Hello,

While inserting the Issuer URL, (at the time of Realm creation) you can just insert the port nos on which your keycloak is running. Eg: http://ip-of-keycloak-machine:keycloak-port/realms/your-realm-name.

Remember /auth part is dropped in newer version of Keycloak. Also when configuring keycloak make sure your `Valid Redirect URL` should not have ending slash, though it sounds vague, but it was giving me errors. Correct `Valid Redirect URL` eg: https://your-proxmox-ip:8006 .

Regards Muhammed : )
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!