Troubleshoot built-in SSO
If a user can't log in through Keycloak, the P4 Web Server log and the table of common problems help you find the cause. Many failures happen after the browser shows that the login succeeded, so the cause is not always visible in the browser.
Check the P4 Web Server log
The P4 Web Server writes messages about logins to the webserver.log file. The file is in the directory that the webserver.log.path configurable sets. To learn more, see Configurables in the P4 CLI Reference.
Resolve common problems
| Symptom | Cause | Solution |
|---|---|---|
|
The browser shows an error from Keycloak about an invalid redirect URI. |
The P4 Web Server sends the value of |
Set |
|
The browser and the web server log show that the login succeeded, but |
The value of |
Set |
|
The first login of a user fails. The browser shows |
The token doesn't contain the claim. Common causes are an attribute that the user profile of the realm doesn't allow, an attribute that is not set on the user, a mapper on an optional client scope, or, when you use an identity provider broker, an Attribute Importer that is not set to Force. |
Complete the claim setup in Keycloak, or set |
|
The first login of a user fails when |
Two Keycloak users share an email address, or no P4 Server user with |
Give each user a unique email address, and set |
|
The browser shows that the login succeeded, but |
The P4 Server user is already linked to a different Keycloak user, for example after you rename a user or reuse a username. P4 Server refuses the link after the browser shows its result, so the browser page doesn't show the failure. |
Log in with the Keycloak user that is linked to the P4 Server user. If the link is no longer correct, for example because you moved users to a new identity provider, contact Perforce Support to clear the link. |
|
The first login of a user on an edge server fails while the commit server is down or unreachable. Later logins of users who have logged in before succeed. |
The edge server sends the first login of each user to the commit server, which links the Keycloak user to the P4 Server user. The edge server can't reach the commit server. |
Restore the connection between the edge server and the commit server, and then log in again. To learn more, see Configure built-in SSO in a distributed environment. |
|
The |
The login was not completed before the time limit that |
Complete the browser login sooner. If logins are slow, increase |
|
Keycloak rejects the client when a user logs in. |
The client secret is not supplied: |
Set the variable in the environment of the p4d service account, and then restart the service. To learn how, see Configure P4 Server for built-in SSO. |
|
Every login fails before Keycloak shows the sign-in page. The P4 Web Server log contains |
The P4 Web Server can't set up its connection to Keycloak. The log message names the cause. Common causes are:
|
Configure Keycloak to use |
|
The |
The P4 Web Server at the address that |
Restart the web server with |
|
The P4 Web Server can't connect to Keycloak because of a certificate error. |
The server doesn't trust the certificate of Keycloak, for example because a private certificate authority signed the certificate. |
Set |
|
The browser returns to the login page repeatedly, or the login never completes. |
The P4 Web Server uses HTTP. Browsers don't return secure session cookies over HTTP. |
Use HTTPS. To learn how, see Configure P4 Server for built-in SSO. |
|
A user that you renamed in P4 Server can't log in. |
The |
Change the |
|
A command with the |
The server can't validate the token. When the server refuses a token, the client can report a password error. Common causes are:
|
Set the |
|
A change to an |
The server picks up most changes within about 10 seconds. A login that is already in progress uses the previous values. The P4 Web Server reads |
Wait about 10 seconds, and then repeat the action. After you change |