public function generate(array $scopes, $lifetime = self::DEFAULT_LIFETIME, $secret_encoded = true)
    {
        $time           = time();
        $payload        = [
            'iat' => $time,
            'scopes' => $scopes,
            'exp' => $time + $lifetime,
            'aud' => $this->audience,
        ];
        $payload['jti'] = md5(json_encode($payload));

        $secret = $secret_encoded ? base64_decode(strtr($this->secret, '-_', '+/')) : $this->secret;

        return JWT::encode($payload, $secret);
    }
public function generate(array $scopes, $lifetime = self::DEFAULT_LIFETIME, $secret_encoded = true)
    {
        $time           = time();
        $payload        = [
            'iat' => $time,
            'scopes' => $scopes,
            'exp' => $time + $lifetime,
            'aud' => $this->audience,
        ];
        $payload['jti'] = md5(json_encode($payload));

        $secret = $secret_encoded ? base64_decode(strtr($this->secret, '-_', '+/')) : $this->secret;

        return JWT::encode($payload, $secret);
    }
public function generate ( array $ scopes , $ lifetime = self :: DEFAULT_LIFETIME , $ secret_encoded = true ) { $ time = time ( ) ; $ payload = [ 'iat' => $ time , 'scopes' => $ scopes , 'exp' => $ time + $ lifetime , 'aud' => $ this -> audience , ] ; $ payload [ 'jti' ] = md5 ( json_encode ( $ payload ) ) ; $ secret = $ secret_encoded ? base64_decode ( strtr ( $ this -> secret , '-_' , '+/' ) ) : $ this -> secret ; return JWT :: encode ( $ payload , $ secret ) ; }
Create the ID token.

@param array   $scopes         Array of scopes to include.
@param integer $lifetime       Lifetime of the token, in seconds.
@param boolean $secret_encoded True to base64 decode the client secret.

@return string
Create the ID token .