Skip to content

Commit

Permalink
Fix for missing session data
Browse files Browse the repository at this point in the history
Signed-off-by: H2CK <dev@jagel.net>
  • Loading branch information
H2CK committed Sep 11, 2024
1 parent f919cf6 commit 00ac392
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 37 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file.

## [0.9.4] - 2024-09-11

### Changed

- Fixed bug for lost session data in case of client authentication uses BasicAuth
- Updated dependencies
- Updated translations

## [0.9.3] - 2024-08-29

### Changed
Expand Down
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Full documentation can be found at:
- [Developer Documentation](https://github.com/H2CK/oidc/wiki#developer-documentation)
]]></description>
<version>0.9.3</version>
<version>0.9.4</version>
<licence>agpl</licence>
<author mail="dev@jagel.net" homepage="https://github.com/H2CK/oidc">Thorsten Jagel</author>
<namespace>OIDCIdentityProvider</namespace>
Expand Down
40 changes: 20 additions & 20 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions lib/Controller/LoginRedirectorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,13 @@ public function authorize(
{
if (!$this->userSession->isLoggedIn()) {
// Not authenticated yet
// Store things in user session to be available after login
$this->session->set('client_id', $client_id);
$this->session->set('state', $state);
$this->session->set('response_type', $response_type);
$this->session->set('redirect_uri', $redirect_uri);
$this->session->set('scope', $scope);
$this->session->set('nonce', $nonce);
// Store oidc attributes in user session to be available after login
$this->session->set('oidc_client_id', $client_id);
$this->session->set('oidc_state', $state);
$this->session->set('oidc_response_type', $response_type);
$this->session->set('oidc_redirect_uri', $redirect_uri);
$this->session->set('oidc_scope', $scope);
$this->session->set('oidc_nonce', $nonce);

$afterLoginRedirectUrl = $this->urlGenerator->linkToRoute('oidc.Page.index', []);

Expand All @@ -216,22 +216,22 @@ public function authorize(
}

if (empty($client_id)) {
$client_id = $this->session->get('client_id');
$client_id = $this->session->get('oidc_client_id');
}
if (empty($state)) {
$state = $this->session->get('state');
$state = $this->session->get('oidc_state');
}
if (empty($response_type)) {
$response_type = $this->session->get('response_type');
$response_type = $this->session->get('oidc_response_type');
}
if (empty($redirect_uri)) {
$redirect_uri = $this->session->get('redirect_uri');
$redirect_uri = $this->session->get('oidc_redirect_uri');
}
if (empty($scope)) {
$scope = $this->session->get('scope');
$scope = $this->session->get('oidc_scope');
}
if (empty($nonce)) {
$nonce = $this->session->get('nonce');
$nonce = $this->session->get('oidc_nonce');
}

// Set default scope if scope is not set at all
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "oidc",
"description": "Use Nextcloud as OIDC Identity Provider",
"version": "0.9.3",
"version": "0.9.4",
"author": "Thorsten Jagel <dev@jagel.net>",
"bugs": {
"url": "https://github.com/H2CK/oidc/issues"
Expand Down

0 comments on commit 00ac392

Please sign in to comment.