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

Oauth2 client configuration parameters visible to users who are not members of the application group #2658

Open
dvv opened this issue Mar 16, 2024 · 1 comment
Labels
bug Something isn't working internals Deep wizardry must-have This blocks the milestone from release

Comments

@dvv
Copy link
Contributor

dvv commented Mar 16, 2024

Ungranted person:

{
  "attrs": {
    "class": ["account", "memberof", "oauth2_resource_server", "oauth2_resource_server_basic", "object"],
    "displayname": ["Test1"],
    "memberof": ["idm_all_accounts"],
    "name": ["test1"],
    "spn": ["test1"],
    "uuid": ["c900060f-7d5a-4d20-9191-dbdcaec69bf4"]
  }
}

Granted person:

{
  "attrs": {
    "class": ["account", "memberof", "oauth2_resource_server", "oauth2_resource_server_basic", "object"],
    "displayname": ["Test2"],
    "memberof": ["idm_all_accounts"],
    "name": ["test2"],
    "oauth2_rs_origin": ["https://..."],
    "spn": ["test2"],
    "uuid": ["c900060f-7d5a-4d20-9191-dbdcaec69bf4"]
  }
}
@dvv
Copy link
Contributor Author

dvv commented Mar 16, 2024

I changed https://github.com/kanidm/kanidm/blob/master/server/lib/src/server/access/search.rs#L187-L200 to read:

            if !contains_o2_rs {
                AccessResult::Ignore
            } else if contains_o2_scope_member {
                security_access!(entry = ?entry.get_uuid(), ident = ?iuser.entry.get_uuid2rdn(), "ident is a memberof a group granted an oauth2 scope by this entry");

                return AccessResult::Allow(btreeset!(
                    Attribute::Class.as_ref(),
                    Attribute::DisplayName.as_ref(),
                    Attribute::Uuid.as_ref(),
                    Attribute::Name.as_ref(),
                    Attribute::OAuth2RsOrigin.as_ref(),
                    Attribute::OAuth2RsOriginLanding.as_ref(),
                    Attribute::Image.as_ref()
                ));
            } else {
              AccessResult::Denied
            }

while waiting for true solution.

@yaleman yaleman added bug Something isn't working internals Deep wizardry must-have This blocks the milestone from release labels Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working internals Deep wizardry must-have This blocks the milestone from release
Projects
Status: 🐛 Bugs
Development

No branches or pull requests

2 participants