Skip to content

Commit

Permalink
get userid from oidc data
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Lange <[email protected]>
  • Loading branch information
ArtificialOwl committed Jan 13, 2025
1 parent ea74e6d commit e610a3a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/UserDiscoveryModules/ManualUserMapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public function __construct(
public function getLocation(array $data): string {
$location = '';
$dictionary = $this->getDictionary();
$key = $this->getKey($data);

$key = $this->getKey($data['saml'] ?? $data['oidc']);
$this->logger->debug('Lookup key is: "' . $key . '"');

// regular lookup
Expand Down Expand Up @@ -112,8 +112,12 @@ private function getDictionary() {
*/
private function getKey($data) {
$key = '';
if (!empty($this->idpParameter) && isset($data['saml'][$this->idpParameter][0])) {
$key = $data['saml'][$this->idpParameter][0];
if (!empty($this->idpParameter) && array_key_exists($this->idpParameter, $data)) {
$keys = $data[$this->idpParameter];
if (!is_array($keys)) {
$keys = [$keys];
}
$key = $keys[0];
$this->logger->debug('Found idpPrameter ' . $this->idpParameter . ' with value "' . $key . '"');
} else {
$this->logger->debug('Could not find idpParamter: ' . $this->idpParameter);
Expand Down

0 comments on commit e610a3a

Please sign in to comment.