Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CAS Server Attributes to manage groups: Add JSON decode option #51

Open
StephaneGuilet opened this issue Feb 14, 2019 · 6 comments
Open

Comments

@StephaneGuilet
Copy link

Dear All,

I am using NextCloud in a CAS environment and of course I am using the App "user_cas" which is well defined except for the use of the attributes to get the groups.
The goal is to limit the groups which can log in. But the CAS server is free to write its own attributes and the way to write it. In ma cas it is like this:
'departmentNumber' => string '[9260, 9253, 9145, 9022, 2211]' (length=30)

So I have modified the code of user_cas/lib/Service/UserService.php by :
# Test for standard 'groups' attribute
else if (array_key_exists('departmentNumber', $casAttributes)) {

                $casGroups = json_decode($casAttributes['departmentNumber']);
            }

Which is working well but it will be deleted for the next update or the next installation. So I was wondering why not writing the value of the attribute to read and the value of this attribute to check.
In my case we would say in the admin interface the attribute for the groups is "departmentNumber" and the value to check would be : "9022"

Thank you for your attention it should be possible to change that. If I manage to do so, I will propose a code. But I am not sure I am able to do so.

Have a nice day,

@StephaneGuilet
Copy link
Author

Test for standard 'groups' attribute

  else if (array_key_exists('departmentNumber', $casAttributes)) {
             $casGroups = json_decode($casAttributes['departmentNumber']);
            }

@felixrupp
Copy link
Owner

Hi @StephaneGuilet,

Thanks for your question, unfortunately your custom CAS attribute format is nothing I can implement like you mentioned, because it would break every other users group attribute format.

I am planning to add an option to customize all CAS-attribute-formats in the next feature release.

Regards,
Felix

@StephaneGuilet
Copy link
Author

StephaneGuilet commented Feb 22, 2019 via email

@felixrupp felixrupp modified the milestones: 1.7, 1.8 Apr 2, 2019
@felixrupp felixrupp modified the milestones: 1.8, 1.9 Dec 2, 2019
@felixrupp felixrupp self-assigned this Feb 7, 2020
@felixrupp
Copy link
Owner

/cib

@create-issue-branch
Copy link

Branch issue-51-CAS_Server_Attributes_to_manage_groups created!

@felixrupp felixrupp changed the title CAS Server Attributes to manage groups CAS Server Attributes to manage groups: Add JSON decode option Dec 22, 2020
@felixrupp
Copy link
Owner

Added with Version 1.9. Please review the function and close the ticket afterwards. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants