mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
OIDC: Moved name claim option handling from config to service
Closes #4494
This commit is contained in:
@ -30,7 +30,7 @@ class OidcTest extends TestCase
|
||||
'auth.method' => 'oidc',
|
||||
'auth.defaults.guard' => 'oidc',
|
||||
'oidc.name' => 'SingleSignOn-Testing',
|
||||
'oidc.display_name_claims' => ['name'],
|
||||
'oidc.display_name_claims' => 'name',
|
||||
'oidc.client_id' => OidcJwtHelper::defaultClientId(),
|
||||
'oidc.client_secret' => 'testpass',
|
||||
'oidc.jwt_public_key' => $this->keyFilePath,
|
||||
@ -408,6 +408,23 @@ class OidcTest extends TestCase
|
||||
$this->assertEquals('xXBennyTheGeezXx', $user->external_auth_id);
|
||||
}
|
||||
|
||||
public function test_auth_uses_mulitple_display_name_claims_if_configured()
|
||||
{
|
||||
config()->set(['oidc.display_name_claims' => 'first_name|last_name']);
|
||||
|
||||
$this->runLogin([
|
||||
'email' => 'benny@example.com',
|
||||
'sub' => 'benny1010101',
|
||||
'first_name' => 'Benny',
|
||||
'last_name' => 'Jenkins'
|
||||
]);
|
||||
|
||||
$this->assertDatabaseHas('users', [
|
||||
'name' => 'Benny Jenkins',
|
||||
'email' => 'benny@example.com',
|
||||
]);
|
||||
}
|
||||
|
||||
public function test_login_group_sync()
|
||||
{
|
||||
config()->set([
|
||||
|
Reference in New Issue
Block a user