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

Admin users switched to non-admin user after login with OIDC #70

Open
Intimaria opened this issue Nov 30, 2022 · 8 comments
Open

Admin users switched to non-admin user after login with OIDC #70

Intimaria opened this issue Nov 30, 2022 · 8 comments

Comments

@Intimaria
Copy link

So if I set a user as administrator in the database, they are able to view the administrator panel and administer the site. However, if they login with OIDC (specifically using Keycloak), the database is changed and the user is set back to non admin.
The plugin seems to be writing to the database with each login.

This is only happening when logging in with OIDC, if the user logs in normally, the database isn´t touched and the user remains and administrator.

@syswipe
Copy link

syswipe commented Dec 2, 2022

I've found the same issue. Have you solved one?

@Intimaria
Copy link
Author

Intimaria commented Dec 2, 2022

Yes, it requires setup on the keycloak administration dashboard for the client. There's a setting in the plugin configuration page where you can set the admin group or role. You have to create an admin group.

These are instructions specifically for Keycloak idp:

  1. Within your client, in the roles tab, add a role, for instance admin.
  2. From within Groups, create a group to define administrators.
  3. Within the group, in role-mappings, select the client for your app, and add to the group the role you just created.
  4. When you add users to the group, they will automatically have the admin role.
  5. Check the JWT Access Token generation. It should include the admin role

@ecswai201
Copy link

ecswai201 commented Dec 16, 2022

can I see your keycloak and redmmine configuration?
i have a trouble in this job 

#75

@sergiovilaseco
Copy link

sergiovilaseco commented Jan 31, 2023

Hi @Intimaria,

I am trying to configure this plugin with Microsoft OpneID. I have added the roles as you mentioned in your previous post but I am still having the same issue (admin users are set as normal users).

This is the token I get from MS:
{
...
"roles": [
"admin"
],
...
}

Is this the way that the plugin is expecting the role? if not, is there any modification I can make on the plugin to adapt it?

Thanks in advance

@Intimaria
Copy link
Author

Hi @Intimaria,

I am trying to configure this plugin with Microsoft OpneID. I have added the roles as you mentioned in your previous post but I am still having the same issue (admin users are set as normal users).

This is the token I get from MS: { ... "roles": [ "admin" ], ... }

Is this the way that the plugin is expecting the role? if not, is there any modification I can make on the plugin to adapt it?

Thanks in advance

Yes, you have to configure the plugin from within redmine to give administrator access to the admin role you created.

@bilelzr
Copy link

bilelzr commented Apr 3, 2023

hello , did any one find a solution still having the same issue :'( .
thank you in advance

@malmoussa
Copy link

Hi I have the same issue.

The token generated by my IDP looks like this, according to the documentation.

{
"sub": "xxxxxxxxxxxxxxxxxx",
"name": "firstname lastname",
"email": "[email protected]",
"ver": 1,
"iss": "url",
"aud": "audience",
"iat": nnnnnnnnn,
"exp": mmmmmmmmm,
"jti": "ID.xxxxxxxxxxxxxxxxxxx",
"amr": [
"pwd"
],
"idp": "IDP",
"preferred_username": "[email protected]",
"auth_time": uuuuuuuu,
"at_hash": "azefegrhtnuoykuil",
"member_of": [
"admin"
]
}

The member_of claim is an array that contain a group which is mapped in redmine to be administrator.

But this doesn't work.

The authentication works but the users are not admin in Redmine.

Could someone help me?

Regards

@vokamut
Copy link

vokamut commented Jul 24, 2023

Made a PR to solve this problem. Added a flag that cancels the group change:
#86

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

No branches or pull requests

7 participants