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

[#67055] Do not use unspecified ServiceProviderConfig.AuthenticationSchemes.type

Pavel Balashou5add4fbbe830
diff --git a/config/static_links.yml b/config/static_links.yml
index c310cc35772..6d977946df6 100644
--- a/config/static_links.yml
+++ b/config/static_links.yml
@@ -182,10 +182,8 @@ sysadmin_docs:
href: https://www.openproject.org/docs/system-admin-guide/authentication/saml/
scim:
href: https://www.openproject.org/docs/system-admin-guide/authentication/scim/
- scim_static_access_token_authentication_method:
- href: https://www.openproject.org/docs/system-admin-guide/authentication/scim/#a-static-access-token
- scim_oauth2_client_credentials_authentication_method:
- href: https://www.openproject.org/docs/system-admin-guide/authentication/scim/#b-oauth-20-client-credentials
+ scim_authentication:
+ href: https://www.openproject.org/docs/system-admin-guide/authentication/scim/#step-3-choose-an-authentication-method
scim_jwt_authetication_method:
href: https://www.openproject.org/docs/system-admin-guide/authentication/scim/#c-jwt-from-identity-provider
text_formatting:
diff --git a/lib/open_project_scimitar.rb b/lib/open_project_scimitar.rb
index c233efb1bb0..ebcfbb435d6 100644
--- a/lib/open_project_scimitar.rb
+++ b/lib/open_project_scimitar.rb
@@ -30,23 +30,11 @@
module OpenProjectScimitar
AUTHENTICATION_SCHEMES = [
- Scimitar::AuthenticationScheme.new(
- type: "oauth2",
- name: "OAuth2",
- description: OpenProject::Static::Links.url_for(:sysadmin_docs, :scim_static_access_token_authentication_method,
- localize_url: false)
- ),
Scimitar::AuthenticationScheme.new(
type: "oauthbearertoken",
name: "OAuth Bearer Token",
- description: OpenProject::Static::Links.url_for(:sysadmin_docs, :scim_oauth2_client_credentials_authentication_method,
- localize_url: false)
- ),
- Scimitar::AuthenticationScheme.new(
- type: "oidcjwt",
- name: "OpenID Provider JWT",
- description: OpenProject::Static::Links.url_for(:sysadmin_docs, :scim_jwt_authetication_method,
- localize_url: false)
+ description: "Bearer Token can be obtained in 3 different ways" \
+ "(#{OpenProject::Static::Links.url_for(:sysadmin_docs, :scim_authentication, localize_url: false)})"
)
].freeze
end
diff --git a/spec/requests/scim_v2/service_provider_config_spec.rb b/spec/requests/scim_v2/service_provider_config_spec.rb
index de80e59efc8..a7de242cf00 100644
--- a/spec/requests/scim_v2/service_provider_config_spec.rb
+++ b/spec/requests/scim_v2/service_provider_config_spec.rb
@@ -47,15 +47,10 @@ RSpec.describe "SCIM API ServiceProviderConfig" do
get "/scim_v2/ServiceProviderConfig", {}, headers
response_body = JSON.parse(last_response.body)
- expect(response_body).to include("authenticationSchemes" => [{ "description" => "https://www.openproject.org/docs/system-admin-guide/authentication/scim/#a-static-access-token",
- "name" => "OAuth2",
- "type" => "oauth2" },
- { "description" => "https://www.openproject.org/docs/system-admin-guide/authentication/scim/#b-oauth-20-client-credentials",
+ expect(response_body).to include("authenticationSchemes" => [{ "description" => "Bearer Token can be obtained in 3 different ways(https://www.openproject.org/docs/system-admin-guide/authentication/scim/#step-3-choose-an-authentication-method)",
+
"name" => "OAuth Bearer Token",
- "type" => "oauthbearertoken" },
- { "description" => "https://www.openproject.org/docs/system-admin-guide/authentication/scim/#c-jwt-from-identity-provider",
- "name" => "OpenID Provider JWT",
- "type" => "oidcjwt" }],
+ "type" => "oauthbearertoken" }],
"bulk" => { "supported" => false },
"changePassword" => { "supported" => false },
"etag" => { "supported" => false },
@@ -86,15 +81,9 @@ RSpec.describe "SCIM API ServiceProviderConfig" do
expect(last_response).to have_http_status(200)
response_body = JSON.parse(last_response.body)
expect(response_body.keys).to eq(["meta", "schemas", "authenticationSchemes"])
- expect(response_body).to include("authenticationSchemes" => [{ "description" => "https://www.openproject.org/docs/system-admin-guide/authentication/scim/#a-static-access-token",
- "name" => "OAuth2",
- "type" => "oauth2" },
- { "description" => "https://www.openproject.org/docs/system-admin-guide/authentication/scim/#b-oauth-20-client-credentials",
+ expect(response_body).to include("authenticationSchemes" => [{ "description" => "Bearer Token can be obtained in 3 different ways(https://www.openproject.org/docs/system-admin-guide/authentication/scim/#step-3-choose-an-authentication-method)",
"name" => "OAuth Bearer Token",
- "type" => "oauthbearertoken" },
- { "description" => "https://www.openproject.org/docs/system-admin-guide/authentication/scim/#c-jwt-from-identity-provider",
- "name" => "OpenID Provider JWT",
- "type" => "oidcjwt" }],
+ "type" => "oauthbearertoken" }],
"schemas" => ["urn:ietf:params:scim:schemas:core:2.0:ServiceProviderConfig"])
end
end