/user/profile endpoint throws error for new users
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 28
- Forks
- 25
- Avg merge
- 4d 22h
- Merged PRs (30d)
- 20
Description
Describe the bug
A fresh CWMS user created upon initial login cannot retrieve their profile through the /user/profile endpoint. It returns an error.
Expected behavior
A freshly-created user would ideally at least be able to view their username, and theoretically an empty roles list (or the single HQ All Users role that currently exists). This enables the user to include their username when requesting permissions.
To Reproduce
Steps to reproduce the behavior:
- Login to CWMS with a new account (so that the system generates a new user)
- Make a GET /user/profile request
- Receive an HTTP 403 error response
Logs/Incident Identifier
Not technically an error, but this is the response body:
{
"message": "Missing roles {Role{name='CWMS Users'}}",
"incidentIdentifier": "6e179fa7-1e9f-4996-aa5e-a6a547dc5789",
"source": "Authorization",
"details": {}
}
CURL Commands
curl -X 'GET' 'http://localhost:8081/cwms-data/user/profile'
CDA Version (please complete the following information):
2026.03.04-develop
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing GET /user/profile with a newly created CWMS account using the provided CURL command, then trace the endpoint's authorization behavior. Confirm that a fresh user can retrieve at least their username with an empty roles list or the existing HQ All Users role, without the HTTP 403 response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, authentication, authorization, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100