This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 224586 - Cannot authenticate using API tokens when CSRF enabled
Summary: Cannot authenticate using API tokens when CSRF enabled
Status: RESOLVED FIXED
Alias: None
Product: connecteddeveloper
Classification: Unclassified
Component: Hudson (show other bugs)
Version: 7.2
Hardware: PC Linux
: P2 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords: NETFIX
Depends on:
Blocks: 193008 195473
  Show dependency tree
 
Reported: 2013-01-07 18:38 UTC by Jesse Glick
Modified: 2013-01-09 02:26 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Proposed patch (7.63 KB, patch)
2013-01-07 18:49 UTC, Jesse Glick
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2013-01-07 18:38:17 UTC
Crumb support is built into ServletConnectionAuthenticator, but this is bypassed when using API tokens. The symptom is that when logging in as (say) jglick to builds.apache.org and trying to start Ant_BuildFromPOMs from NetBeans, you are repeatedly prompted for a password or API token and the build is never started.

Explicitly logging in first does not help. The problem is that ServletConnectionAuthenticator is canceled out of, APITokenConnectionAuthenticator is called, and this yields a valid login (200) on a GET request; but then when POSTing delay=0sec to /build, Jenkins checks for a crumb (only required on POST requests!), sending a 403 “No valid crumb was included in the request”. NetBeans sees the 403 and prompts you to log in again.
Comment 1 Jesse Glick 2013-01-07 18:49:16 UTC
Created attachment 129973 [details]
Proposed patch
Comment 2 Jaroslav Havlin 2013-01-08 09:35:27 UTC
Integrated as http://hg.netbeans.org/core-main/rev/e09b72c6b1bf
Thanks, Jesse!
Comment 3 Quality Engineering 2013-01-09 02:26:45 UTC
Integrated into 'main-golden', will be available in build *201301090001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/e09b72c6b1bf
User: Jesse Glick <jglick@netbeans.org>
Log: #224586: permit API token authentication when using crumbs for CSRF protection.
Crumb handling is orthogonal to authentication so should be handled in ConnectionBuilder.