Skip to content
Closed
Show file tree
Hide file tree
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
10 changes: 9 additions & 1 deletion src/Kanidm/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,20 @@ protected function getBaseUrl(): string
throw new InvalidArgumentException('Missing base URL value.');
}

/**
* PKCE is the default in recent versions of Kanidm, and heavily encouraged
* to be enforced whenever possible.
*/
if (!$this->usesPKCE() && $this->getConfig('enable_pkce')) {
$this->enablePKCE();
}

return $baseUrl;
}

public static function additionalConfigKeys(): array
{
return ['base_url'];
return ['base_url', 'enable_pkce'];
}

protected function getAuthUrl($state): string
Expand Down
3 changes: 3 additions & 0 deletions src/Kanidm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ Please see the [Base Installation Guide](https://socialiteproviders.com/usage/),
'client_secret' => env('KANIDM_CLIENT_SECRET'),
'redirect' => env('KANIDM_REDIRECT_URI'),
'base_url' => env('KANIDM_BASE_URL'),

// Recommended for security reasons and is default for OAuth clients in Kanidm
'enable_pkce' => env('KANIDM_ENABLE_PKCE', true),
],
```

Expand Down
Loading