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

Provide a set of endpoints for user management #418

Closed
syntrydy opened this issue Aug 4, 2021 · 15 comments
Closed

Provide a set of endpoints for user management #418

syntrydy opened this issue Aug 4, 2021 · 15 comments
Milestone

Comments

@syntrydy
Copy link
Contributor

syntrydy commented Aug 4, 2021

User Story Title.

Implement endpoints for user management

User Story Meta Information.

This should be base on the existing SCIM project

Priority.

MEDIUM

Description.

As an API consumer with the user management permission set, I should be able to:

  • List all users
  • Search for users base on a search pattern
  • Add new user
  • Update existing user
  • Remove a user
  • Activate/Deactivate a user
  • Manage user password:
    1. Password policy: define the password complexity(eg. min length,
    2. Password Reset: reset my password
    3. Username Recovery
@pujavs pujavs self-assigned this Aug 23, 2021
@pujavs
Copy link
Contributor

pujavs commented Oct 1, 2021

Implemented endpoints for User Management.
Regarding, Manage user password there is nothing specific in scim regarding password policy management. This will need more decision on what should be the policy and best place to implement it. It will be good to create a sperate JIRA for the same with proper details to take fwd.

@syntrydy
Copy link
Contributor Author

syntrydy commented Oct 6, 2021

I think we can ignore Password management for now, because we don’t have it implement in SCIM.

@pujavs
Copy link
Contributor

pujavs commented Oct 8, 2021

@pujavs pujavs closed this as completed Jan 7, 2022
@ossdhaval ossdhaval transferred this issue from another repository Jan 14, 2022
@duttarnab duttarnab reopened this Mar 23, 2022
@duttarnab
Copy link
Contributor

duttarnab commented Mar 23, 2022

Reopening this issue, as scim endpoints are not sufficient to include Custom schema in Flex Admin UI.

image

  • Manage Groups are not required in Admin UI.

We will need the following endpoints in config-api for User Management

  • GET /jans-config-api/api/v1/users (get all users)
  • POST /jans-config-api/api/v1/users (create a user)
  • GET /jans-config-api/api/v1/users/{inum} (get a user by inum)
  • PUT /jans-config-api/api/v1/users/{inum} (update a user)
  • DELETE /jans-config-api/api/v1/users/{inum} (delete a user)
  • PATCH /jans-config-api/api/v1/users/{inum} (patch user attributes)

The above APIs will perform CRUD on jansPerson table.

The payload from the API will be in the below format.

{
    "dn": "string",
    "inum": "string",
    "givenName": "string",
    "displayName: "string",
    "sn": "string",
    "mail": "string",
    "userPassword": "string",
    "jansStatus": "string",
    "customAttributes" : [{ "attr1_name": "attr1_value"}, {"attr2_name": "attr2_value}", ...]
}

here customAttributes will contain all user claims and their values from jansPerson person table.

cc: @yuriyz @yurem @nynymike

@yurem
Copy link
Contributor

yurem commented Mar 26, 2022

I think we should not expose user API in this application. Why we can't use SCIM and configure it to conform our requirements?
We should keep minimum count of services which can expose/modify user data.
@nynymike

@nynymike
Copy link
Contributor

I agree with Yura. What is the advantage to exposing endpoints that just duplicate the functionality of SCIM?

@duttarnab
Copy link
Contributor

duttarnab commented Mar 28, 2022

@yurem @nynymike , SCIM apis does not provide all attributes from jansPerson table. As @jgomer2001 has mentioned

image
image

Moreover, if a user manually updates the schema to add a new attribute to jansPerson table then this attribute will also not be available using SCIM apis as it does not provide all attributes.

That's why we are thinking to create new User Management APIs in config-api.

@yurem
Copy link
Contributor

yurem commented Mar 29, 2022

After manual schema update did you register this attribute in ou=attributes? In Jans CE setup there are scim test data. You can use -t option to prepare test server. In scim-test-data.ldif setup registers 3 custom attributes which uses in tests.

@duttarnab
Copy link
Contributor

We need to remove password from the response of the below endpoints because if we have the user password in the get endpoint response then it can be easily traced from the browser console.

  • GET /jans-config-api/api/v1/users (get all users)
  • GET /jans-config-api/api/v1/users/{inum} (get a user by inum)

@pujavs
Copy link
Contributor

pujavs commented Apr 8, 2022

Implemented:

  • PATCH endpoint -> /jans-config-api/api/v1/user/{inum}
  • Exclusion of userPassword in fetch request
    • GET /jans-config-api/api/v1/users (get all users)
    • GET /jans-config-api/api/v1/users/{inum} (get a user by inum)

Test results:
src.test.resources.feature.user.user.pdf

@pujavs
Copy link
Contributor

pujavs commented Apr 13, 2022

Post discussion with @nynymike and @jgomer2001, since adding all 'jansPersonattributes to SCIM api is not advisable as there are many attributes and it is decided to **remove theSCIM - User Managementendpoint and convert the new configUser Management` endpoint into plugin.**

image

Refer older comment from this issue as well:
#418 (comment)

@pujavs
Copy link
Contributor

pujavs commented Apr 18, 2022

@duttarnab changes done for following

  1. Removing scim user management endpoint
  2. Moving user management endpoint in user-mgt-plugin.
    Note change in endpoint url, new url is /jans-config-api/mgt/configuser

Testing evidence:
src.test.resources.feature.mgt.user.user.pdf

@pujavs pujavs closed this as completed May 4, 2022
@pujavs
Copy link
Contributor

pujavs commented Jun 8, 2022

Issue: For user management endpoints mail,displayName,jansStatus,userPassword,givenName have been made mandatory fields and the endpoint does not return userPassword.
This will work fine for POST - create user request.
However since 'userPasswordis not returned the PUT methods throws error ifuserPassword` is not provided.

Example: jans-cli uses swagger spec in which the mandatory fields have to be specified at the object level.
So the PUT request throws error as it does not contain userPassword.

Resolution: To resolve this it is decided to make userPassword mandatory only for POST method

@pujavs pujavs reopened this Jun 8, 2022
@moabu moabu added this to the 1.0.1 milestone Jun 15, 2022
@moabu moabu modified the milestones: 1.0.1, 1.0.2 Jul 8, 2022
@pujavs
Copy link
Contributor

pujavs commented Jul 15, 2022

This requirement and related enhancements for root level attributes and mandatory attribute check was implemented on 08-Jun-2022 hence closing the same.

@pujavs pujavs closed this as completed Jul 15, 2022
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

6 participants