src/OAuth2/OpenID/ResponseType/IdToken.php
public function createIdToken($client_id, $userInfo, $nonce = null, $userClaims = null, $access_token = null)
    {
        // pull auth_time from user info if supplied
        list($user_id, $auth_time) = $this->getUserIdAndAuthTime($userInfo);

        $token = array(
            'iss'        => $this->config['issuer'],
            'sub'        => $user_id,
            'aud'        => $client_id,
            'iat'        => time(),
            'exp'        => time() + $this->config['id_lifetime'],
            'auth_time'  => $auth_time,
        );

        if ($nonce) {
            $token['nonce'] = $nonce;
        }

        if ($userClaims) {
            $token += $userClaims;
        }

        if ($access_token) {
            $token['at_hash'] = $this->createAtHash($access_token, $client_id);
        }

        return $this->encodeToken($token, $client_id);
    }
public function createIdToken($client_id, $userInfo, $nonce = null, $userClaims = null, $access_token = null)
    {
        // pull auth_time from user info if supplied
        list($user_id, $auth_time) = $this->getUserIdAndAuthTime($userInfo);

        $token = array(
            'iss'        => $this->config['issuer'],
            'sub'        => $user_id,
            'aud'        => $client_id,
            'iat'        => time(),
            'exp'        => time() + $this->config['id_lifetime'],
            'auth_time'  => $auth_time,
        );

        if ($nonce) {
            $token['nonce'] = $nonce;
        }

        if ($userClaims) {
            $token += $userClaims;
        }

        if ($access_token) {
            $token['at_hash'] = $this->createAtHash($access_token, $client_id);
        }

        return $this->encodeToken($token, $client_id);
    }
public function createIdToken ( $ client_id , $ userInfo , $ nonce = null , $ userClaims = null , $ access_token = null ) { // pull auth_time from user info if supplied list ( $ user_id , $ auth_time ) = $ this -> getUserIdAndAuthTime ( $ userInfo ) ; $ token = array ( 'iss' => $ this -> config [ 'issuer' ] , 'sub' => $ user_id , 'aud' => $ client_id , 'iat' => time ( ) , 'exp' => time ( ) + $ this -> config [ 'id_lifetime' ] , 'auth_time' => $ auth_time , ) ; if ( $ nonce ) { $ token [ 'nonce' ] = $ nonce ; } if ( $ userClaims ) { $ token += $ userClaims ; } if ( $ access_token ) { $ token [ 'at_hash' ] = $ this -> createAtHash ( $ access_token , $ client_id ) ; } return $ this -> encodeToken ( $ token , $ client_id ) ; }
Create id token

@param string $client_id
@param mixed  $userInfo
@param mixed  $nonce
@param mixed  $userClaims
@param mixed  $access_token
@return mixed|string
Create id token