[JIRA] (JENKINS-61371) API tokens not persisted until user config screen is saved

0 views
Skip to first unread message

jglick@cloudbees.com (JIRA)

unread,
Mar 6, 2020, 10:43:03 AM3/6/20
to jenkinsc...@googlegroups.com
Jesse Glick created an issue
 
Jenkins / Bug JENKINS-61371
API tokens not persisted until user config screen is saved
Issue Type: Bug Bug
Assignee: Wadeck Follonier
Components: core
Created: 2020-03-06 15:42
Priority: Minor Minor
Reporter: Jesse Glick

If in /me/configure you click Add new Token, one will be generated and it will start working immediately. But, after restarting Jenkins it will be gone. You need to Save (or at least Apply).

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

wfollonier@cloudbees.com (JIRA)

unread,
Mar 27, 2020, 6:35:02 AM3/27/20
to jenkinsc...@googlegroups.com
Wadeck Follonier commented on Bug JENKINS-61371
 
Re: API tokens not persisted until user config screen is saved

Jesse Glick Could you provide additional information there?
I tried reproducing the bug, but was not able to create an API Token without saving the user. In terms of code, the doGenerateNewToken method which create the token, contains a save call => https://github.com/jenkinsci/jenkins/blob/838f4ab504ccd6f8fe14afa9a650a53a366bd131/core/src/main/java/jenkins/security/ApiTokenProperty.java#L488

wfollonier@cloudbees.com (JIRA)

unread,
Mar 27, 2020, 7:42:04 AM3/27/20
to jenkinsc...@googlegroups.com
Wadeck Follonier edited a comment on Bug JENKINS-61371
[~jglick] Could you provide additional information there?
I tried reproducing the bug, but was not able to create an API Token without saving the user. In terms of code, the doGenerateNewToken method which
create creates the token, contains a save call => https://github.com/jenkinsci/jenkins/blob/838f4ab504ccd6f8fe14afa9a650a53a366bd131/core/src/main/java/jenkins/security/ApiTokenProperty.java#L488

jglick@cloudbees.com (JIRA)

unread,
Mar 27, 2020, 4:14:02 PM3/27/20
to jenkinsc...@googlegroups.com
Jesse Glick resolved as Cannot Reproduce
 

Hmm, cannot reproduce now. I know I have seen this at least twice.

Change By: Jesse Glick
Status: Open Resolved
Resolution: Cannot Reproduce

jglick@cloudbees.com (JIRA)

unread,
Apr 16, 2020, 3:23:02 PM4/16/20
to jenkinsc...@googlegroups.com
Jesse Glick commented on Bug JENKINS-61371
 
Re: API tokens not persisted until user config screen is saved

James Nord may have seen this recently. Just happened to me now in CloudBees Core. There was an empty <tokenList/> in $JENKINS_HOME/users/*/config.xml. Not sure what triggers this.

jnord@cloudbees.com (JIRA)

unread,
Apr 16, 2020, 5:12:03 PM4/16/20
to jenkinsc...@googlegroups.com

Jesse Glick in core there is a sync between user information from Operations Center to masters when you login.  you can opt out (I think it's opt-out not opt-in in the users preferences).  if you are opted in you have to set the token for the user operations center and then login to the master so it is synced. (at least from memory)

 

this may (or may not) be what you saw.

that said I'm sure I think I saw this (again on core) but operations center login was certainly not involved at that time.

jglick@cloudbees.com (JIRA)

unread,
Apr 17, 2020, 9:01:04 AM4/17/20
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages