Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117766207
D5619.1775232071.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D5619.1775232071.diff
View Options
diff --git a/src/app/Auth/IdentityEntity.php b/src/app/Auth/IdentityEntity.php
--- a/src/app/Auth/IdentityEntity.php
+++ b/src/app/Auth/IdentityEntity.php
@@ -48,6 +48,11 @@
$claims['auth.token'] = Utils::tokenCreate((string) $this->user->id, $ttl);
}
+ // A custom scope/claim that allows us to use an old user identifier (e.g. after a migration from an old system)
+ if (in_array('uuid', $scopes)) {
+ $claims['uuid'] = (string)($this->user->getSetting('uid') ?: $this->user->id);
+ }
+
return $claims;
}
}
diff --git a/src/app/Auth/OAuth.php b/src/app/Auth/OAuth.php
--- a/src/app/Auth/OAuth.php
+++ b/src/app/Auth/OAuth.php
@@ -127,7 +127,7 @@
{
$response = [
// Per OIDC spec. 'sub' must be always returned
- 'sub' => $user->getSetting('uid') ?: $user->id,
+ 'sub' => $user->id,
];
if ($user->tokenCan('email')) {
diff --git a/src/config/openid.php b/src/config/openid.php
--- a/src/config/openid.php
+++ b/src/config/openid.php
@@ -15,6 +15,7 @@
// 'address' => 'Information about your address',
// 'login' => 'See your login information',
'auth.token' => 'Kolab authentication token',
+ 'uuid' => 'User unique identifier',
],
],
@@ -32,6 +33,7 @@
'auth.token' => [
'auth.token',
],
+ 'uuid' => ['uuid'],
],
// You can override the repositories below.
diff --git a/src/resources/lang/en/auth.php b/src/resources/lang/en/auth.php
--- a/src/resources/lang/en/auth.php
+++ b/src/resources/lang/en/auth.php
@@ -20,6 +20,8 @@
'claim.unknown' => "Unknown claim",
'claim.email' => "See your email address",
'claim.auth.token' => "Have read and write access to all your data",
+ 'claim.openid' => "See your email/id via a standard authorization token (OIDC)",
+ 'claim.uuid' => "See your unique user identifier",
'error.password' => "Invalid password",
'error.password-expired' => "Expired password",
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 3, 4:01 PM (21 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18795015
Default Alt Text
D5619.1775232071.diff (2 KB)
Attached To
Mode
D5619: OIDC: Support uuid scope/claim
Attached
Detach File
Event Timeline