Single Sign-On PHP configuration

P4 Code Review supports P4 AS (HAS) as a Single Sign-On (SSO) provider. This helps to simplify configuration and create a more robust SSO solution.

If you make a configuration change, P4 Code Review will not use it until the configuration cache has been reloaded, this forces P4 Code Review to use the new configuration.

You must be an admin or super user to reload the P4 Code Review config cache. Navigate to the User id dropdown menu, select System Information, click the Cache Info tab, and click the Reload Configuration button.

P4 AS

To use P4 Code Review with a P4 Server that is configured to use the P4 AS, you must set the P4 Code Review sso configurable to either optional or enabled in the Swarm configuration file.

The P4 AS acts as the SAML Identity Provider (IdP) for P4 Code Review's Service Provider (SP) and enables authentication with your external IdP using the protocol the administrator has configured in the P4 AS.

Configuring P4 Code Review for P4 AS:

Update the config.php file to enabled SSO.

Set sso to one of the following in the SWARM_ROOT/data/config.php file.

  • enabled all users must use P4 AS to log in to P4 Code Review.

    The login page displays an input box to enter the email or username. Once the input box is filled, the Log in with SSO button is activated. See Log in with SSO.

  • optional P4 AS is available for users to log in to P4 Code Review but is not enforced.

    The login page displays an input box to enter the email or username. Once the input box is filled, the Log in with SSO button is enabled. To log in with SSO, see Log in with SSO.

    The user can also manually log in to P4 Code Review using the Log in with credentials button. To log in manually, see Log in with a password.

    If you switch to Log in with credentials and then decide to use single sign-on, click Log in with SSO.

  • disabled P4 AS is not available to P4 Code Review. This is the default value.

    The login page displays two input boxes to enter the email or username, and to enter the password. Once the input boxes are filled, the Log in with credentials button is activated. See Log in with a password.

Below is an example of the SWARM_ROOT/data/config.php file with SSO enabled.

<?php
    return array(
        'p4' => array(
            'port'      => 'my-helix-core-server:1666',
            'user'      => 'admin_userid',
            'password'  => 'admin user ticket or password',
            'sso'       => 'enabled', // 'disabled'|'optional'|'enabled'
                                       // default value is 'disabled' 
         ),
         'log' => array(
             'priority'  => 3, // 7 for max, defaults to 3
         ),
         'mail' => array(
             'transport' => array(
                 'host' => 'my.mx.host',
             ),
         ),
    );