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

Add support for LDAP #66

Open
KAllan357 opened this issue May 16, 2013 · 5 comments
Open

Add support for LDAP #66

KAllan357 opened this issue May 16, 2013 · 5 comments
Labels
Milestone

Comments

@KAllan357
Copy link
Contributor

Need to support configuring and getting information about the LDAP end points.

@josephholsten
Copy link

Will require adding NexusLdapAuthenticationRealm to NexusCli::GlobalSettingsActions.get_global_settings['data']['securityRealms']. Investigating the other changes required.

Probably will require other things for Nexus Pro.

@josephholsten
Copy link

It'll also need to PUT against /service/local/ldap/conn_info:

{
    "data": {
        "protocol": "ldap",
        "host": "dc-001.fabricam.net",
        "port": 389,
        "searchBase": "DC=intsm,DC=net",
        "authScheme": "DIGEST-MD5",
        "systemUsername": "--FAKE-USERNAME--",
        "systemPassword": "--FAKE-PASSWORD--"
    }
}

and against /service/local/ldap/user_group_info:

{
    "data": {
        "userBaseDn": "cn=Users",
        "userSubtree": false,
        "userObjectClass": "user",
        "userIdAttribute": "sAMAccountName",
        "userRealNameAttribute": "cn",
        "emailAddressAttribute": "mail",

        "ldapGroupsAsRoles": true,

        "groupBaseDn": "cn=Groups",
        "groupSubtree": false,
        "groupObjectClass": "groupOfUniqueNames",
        "groupIdAttribute": "cn",
        "groupMemberAttribute": "uniqueMember",
        "groupMemberFormat": "${username}",

        "userMemberOfAttribute": "memberOf"
    }
}

This is really just for Active Directory setups, but I assume it would be easy enough to modify to a normal LDAP service.

After that, it'll require some calls to set up External Role Mappings. Investigating that now.

@josephholsten
Copy link

hmm, I'm not having much luck with the api calls for roles. I've noticed that it does effect $NEXUSPATH/nexus/sonatype-work/nexus/conf/security.xml, adding something like:

  <roles>
    <role>
      <id>Domain Admins</id>
      <name>Domain Admins</name>
      <description>External mapping for Domain Admins (LDAP)</description>
      <roles>
        <role>nx-admin</role>
      </roles>
    </role>
  </roles>

This doesn't really help the cli much, but can help config management.

@KAllan357
Copy link
Contributor Author

conn_info and user_group_info both make sense. I'm not very familiar with how roles work. Maybe editing that security.xml is something that should be left to the nexus cookbook?

@josephholsten
Copy link

Ah, I think I've got it. Seems like it just takes a POST to /service/local/roles with:

{
    "data": {
        "id": "Domain Admins",
        "name": "Domain Admins",
        "description": "External mapping for Domain Admins (LDAP)",
        "sessionTimeout": 60,
        "roles": [
            "nx-admin"
        ],
        "privileges": []
    }
}

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

No branches or pull requests

2 participants