Skip to content

Commit

Permalink
Merge pull request #105 from nextcloud/backport/104/stable25
Browse files Browse the repository at this point in the history
[stable25] pass idp to sls
  • Loading branch information
ArtificialOwl authored Apr 20, 2023
2 parents fb8af2a + e5dec7e commit 6ab5fcc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/Controller/MasterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,16 @@ public function __construct(
*/
public function autoLogout(?string $jwt) {
try {
if ($jwt !== null && $this->master->isValidJwt($jwt)) {
if ($jwt !== null) {
$key = $this->gss->getJwtKey();
$decoded = (array)JWT::decode($jwt, new Key($key, Application::JWT_ALGORITHM));

$idp = $decoded['saml.idp'] ?? null;

$logoutUrl = $this->urlGenerator->linkToRoute('user_saml.SAML.singleLogoutService');
if (!empty($logoutUrl) && $idp !== null) {
if (!empty($logoutUrl)) {
$token = [
'logout' => 'logout',
'idp' => $idp,
'exp' => time() + 300, // expires after 5 minutes
];

Expand Down

0 comments on commit 6ab5fcc

Please sign in to comment.