Actions
Defect #12472
closedRoles REST API does not accept API authentication
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Fixed
Affected version:
Description
While using the Roles REST API, I encountered a bogus issue with authentication while the global setting "Authentication required" was on : I could not fetch /roles.{json|xml}, I always got a 401 whatever auth I tried (cookie, plain, header).
The following patch against SVN trunk should fix it, at least it works correctly now for me :
Index: app/controllers/roles_controller.rb =================================================================== --- app/controllers/roles_controller.rb (revision 10851) +++ app/controllers/roles_controller.rb (working copy) @@ -19,8 +19,8 @@ layout 'admin' before_filter :require_admin, :except => [:index, :show] - before_filter :require_admin_or_api_request, :only => [:index, :show] before_filter :find_role, :only => [:show, :edit, :update, :destroy] + accept_api_auth :index, :show def index respond_to do |format|
Related issues
Updated by Jean-Philippe Lang about 12 years ago
- Subject changed from Roles REST API auth incorrect to Roles REST API does not accept API authentication
- Category changed from Accounts / authentication to REST API
- Status changed from New to Resolved
- Assignee set to Jean-Philippe Lang
- Target version set to 2.1.5
Fixed in r10893.
Updated by Jean-Philippe Lang about 12 years ago
- Tracker changed from Patch to Defect
- Status changed from Resolved to Closed
- Resolution set to Fixed
Merged.
Updated by Toshi MARUYAMA about 12 years ago
- Status changed from Closed to Reopened
In 2.1-stable and 1.4-stable, "accept_api_auth" is duplicates.
Is it correct?
source:branches/2.1-stable/app/controllers/roles_controller.rb@10895#L24
accept_api_auth :index
accept_api_auth :index, :show
Updated by Toshi MARUYAMA about 12 years ago
RolesController#show added at trunk r10620.
1.4-stable and 2.1-stable don't have RolesController#show.
Updated by Jean-Philippe Lang about 12 years ago
- Status changed from Reopened to Closed
- Target version changed from 2.1.5 to 2.2.0
- Affected version (unused) set to devel
You're right. Reverted in stable branches.
Actions