Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions MicrosoftGraphProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,21 @@ public function getAvatar($token = null){
}
return null;
}

/**
* Return the logout endpoint with an optional post_logout_redirect_uri query parameter.
* ( Copy from socialiteproviders/microsoft/Provider.php )
*
* @param string|null $redirectUri The URI to redirect to after logout, if provided.
* If not provided, no post_logout_redirect_uri parameter will be included.
* @return string The logout endpoint URL.
*/
public function getLogoutUrl(?string $redirectUri = null)
{
$logoutUrl = sprintf('https://login.microsoftonline.com/%s/oauth2/logout', $this->getConfig('tenant', 'common'));

return $redirectUri === null ?
$logoutUrl :
$logoutUrl.'?'.http_build_query(['post_logout_redirect_uri' => $redirectUri], '', '&', $this->encodingType);
}
}