openkfw / TruBudget

A blockchain-based workflow tool for efficient and transparent project management
https://openkfw.github.io/trubudget-website/
GNU General Public License v3.0
83 stars 39 forks source link

API: remove groups data from token #1755

Closed SamuelPull closed 2 months ago

SamuelPull commented 3 months ago

The bug: At some point, there was a bug while authenticating with the admin user (which is used to create all projects/components/etc. automatically). Only this user was concerned, and no action was possible with it.

The cause: The reason was the length of the authentication token. This token is generated using several information, one of them being the groups the user is a part of. However, in certain scenario, for each new project, 4 new groups are created automatically with the admin user. Thus, you can understand that with over 30 projects, this user belongs to a lot of groups and this number is only growing.

What we propose: We would recommend changing the data used for generating the token or simply the way it is generated in TruBudget core. Indeed, this situation could happen again with other partners and the number of groups a user belongs to should not prevent him from authenticating.

EDIT: Groups are removed from only those tokens that couldn't be handled as a cookie.