getLogoutUrl() public static method

Returns the URL to which the user must be redirected to logout from the OpenID provider (i.e. PayPal)
public static getLogoutUrl ( string $redirectUri, string $idToken, ApiContext $apiContext = null ) : string
$redirectUri string Uri on merchant website to where the user must be redirected to post logout
$idToken string id_token from the TokenInfo object
$apiContext PayPal\Rest\ApiContext Optional API Context
return string logout URL
Exemplo n.º 1
0
 /**
  * @test
  */
 public function testLogoutWithCustomConfig()
 {
     $redirectUri = 'http://mywebsite.com';
     $idToken = 'abc';
     $expectedBaseUrl = "https://www.paypal.com/webapps/auth/protocol/openidconnect/v1/endsession";
     $this->assertEquals($expectedBaseUrl . "?id_token={$idToken}&redirect_uri=" . urlencode($redirectUri) . "&logout=true", OpenIdSession::getLogoutUrl($redirectUri, $idToken, $this->context), "Failed case - custom config");
 }