Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Add comments to bearer token stategies.

Pavel Balashou5c57582a1a36
diff --git a/lib_static/open_project/authentication/strategies/warden/doorkeeper_oauth.rb b/lib_static/open_project/authentication/strategies/warden/doorkeeper_oauth.rb
index d3d2a82ea1f..ac80d71effe 100644
--- a/lib_static/open_project/authentication/strategies/warden/doorkeeper_oauth.rb
+++ b/lib_static/open_project/authentication/strategies/warden/doorkeeper_oauth.rb
@@ -7,6 +7,8 @@ module OpenProject
class DoorkeeperOAuth < ::Warden::Strategies::Base
include FailWithHeader
+ # The strategy is supposed to handle bearer tokens that are not JWT.
+ # These tokens are issued by OpenProject
def valid?
access_token = ::Doorkeeper::OAuth::Token
.from_request(decorated_request, *Doorkeeper.configuration.access_token_methods)
diff --git a/lib_static/open_project/authentication/strategies/warden/jwt_oidc.rb b/lib_static/open_project/authentication/strategies/warden/jwt_oidc.rb
index 3eceb6d977a..e1d829d1919 100644
--- a/lib_static/open_project/authentication/strategies/warden/jwt_oidc.rb
+++ b/lib_static/open_project/authentication/strategies/warden/jwt_oidc.rb
@@ -11,6 +11,8 @@ module OpenProject
RS512
].freeze
+ # The strategy is supposed to only handle JWT.
+ # These tokens are supposed to be issued by configured OIDC.
def valid?
@access_token = ::Doorkeeper::OAuth::Token.from_bearer_authorization(
::Doorkeeper::Grape::AuthorizationDecorator.new(request)