jenkinsci / jenkinsci/credentials-plugin
[JENKINS-70719] Creating a new credential with an existing ID returns a 302 response code instead of blocking the submission
- Dominant language
- Java
- Stars
- 134
- Forks
- 258
- Avg merge
- 48m
- Merged PRs (30d)
- 1
Description
When attempting to add a new credential in Jenkins with an already existing ID, the user is notified that "This ID is already in use", however, the user is able to click on the 'create' button which results in a 302 status code. The expected behavior should be to block the submission in case of an already-used ID or return an error status.

---
Originally reported by
benipeled, imported from: Creating a new credential with an existing ID returns a 302 response code instead of blocking the submission
Raw content of original issue
When attempting to add a new credential in Jenkins with an already existing ID, the user is notified that "This ID is already in use", however, the user is able to click on the 'create' button which results in a 302 status code. The expected behavior should be to block the submission in case of an already-used ID or return an error status.
- environment:
Jenkins 2.389
1 attachment
- [image-2023-03-02-18-02-30-409.png](https://issues.jenkins.io/secure/attachment/60056/image-2023-03-02-18-02-30-409.png)
> 
Contributor guide
Research direction
Start by reproducing duplicate credential creation in the credentials-plugin using the Jenkins 2.389 scenario described in the issue. Trace the existing-ID validation and create submission, then verify that an already-used ID blocks submission or returns an error instead of a 302 response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100