gate-sso / gate

Gate is MFA Enabled SSO Platform that supports SAML, OAuth, Linux shell login and CAS
https://gate-sso.github.io
MIT License
203 stars 52 forks source link

Added id to be returned in user get request #173

Closed Jemereny closed 5 years ago

Jemereny commented 5 years ago

TheAPI is /api/v1/users/profile endpoint is returning uid of the user while the /api/v1/group/{:group_id}/users uses the id of the user. Hence we are unable to use the uid obtained to add users into the groups.

In https://github.com/gate-sso/gate/blob/master/app/models/user.rb, Two ids are being used, but they are more or less related with each other. From our understanding of the implementation of generate_uid(uid_buffer=5000). However, from trying out different emails we realized that uid and id do not always have the same difference of 5000 (so we are unable to do a simple subtraction to obtain the required id.