Skip to content
Merged
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
4 changes: 4 additions & 0 deletions action.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ public function getUser()
$data['mail'] = $result['email'];
$data['grps'] = array_merge($result['groups'] ?? [], $result['roles'] ?? []);

if ($this->getConf('stripdomain')) {
$data['user'] = explode('@', $data['user'], 2)[0];
}

if ($this->getConf('fetchgroups')) {
$usergroups = $oauth->request(Azure::GRAPH_MEMBEROF);
$usergroups = json_decode($usergroups, true);
Expand Down
1 change: 1 addition & 0 deletions conf/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
$conf['secret'] = '';
$conf['tenant'] = '';
$conf['fetchgroups'] = 0;
$conf['stripdomain'] = 0;
1 change: 1 addition & 0 deletions conf/metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
$meta['secret'] = array('password');
$meta['tenant'] = array('string');
$meta['fetchgroups'] = array('onoff');
$meta['stripdomain'] = array('onoff');
1 change: 1 addition & 0 deletions lang/en/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
$lang['secret'] = 'Cient Secret';
$lang['openidurl'] = 'Your tenant name or ID';
$lang['fetchgroups'] = 'By default only roles from the JWT are used as user groups. Enabling this option fetches group data.';
$lang['stripdomain'] = 'Strip @domain from preferred_username';