You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by "nscendoni (via GitHub)" <gi...@apache.org> on 2026/02/25 10:14:21 UTC

[PR] SLING-13049 Enhance OIDC authentication with support for SP-initiated logout [sling-org-apache-sling-auth-oauth-client]

nscendoni opened a new pull request, #44:
URL: https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44

   - Added support for SP-initiated single logout by introducing an end_session_endpoint configuration in OidcConnectionImpl.
   - Updated OidcAuthenticationHandler to handle logout redirection to the IdP's end session endpoint.
   - Implemented logic to store the ID token for use during logout.
   - Enhanced tests to verify the correct behavior of the logout process, including redirection and allowed hosts validation.
   - Refactored related classes to accommodate new logout functionality.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] SLING-13119 Enhance OIDC authentication with support for SP-initiated logout [sling-org-apache-sling-auth-oauth-client]

Posted by "rombert (via GitHub)" <gi...@apache.org>.
rombert commented on code in PR #44:
URL: https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44#discussion_r3014617922


##########
src/main/java/org/apache/sling/auth/oauth_client/impl/JcrUserHomeOAuthTokenStore.java:
##########
@@ -40,10 +43,7 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static org.osgi.service.component.annotations.ConfigurationPolicy.REQUIRE;
-
-// a config class is intentionally not defined, but a config is required to select an implementation
-@Component(configurationPolicy = REQUIRE)
+@Component(property = "service.ranking:Integer=0")

Review Comment:
   With the latest changes `(configurationPolicy = REQUIRE)` is still missing.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] SLING-13119 Enhance OIDC authentication with support for SP-initiated logout [sling-org-apache-sling-auth-oauth-client]

Posted by "rombert (via GitHub)" <gi...@apache.org>.
rombert commented on PR #44:
URL: https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44#issuecomment-4056524451

   @nscendoni - I started today but it's still a lot of code :-) Will continue next week


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] SLING-13119 Enhance OIDC authentication with support for SP-initiated logout [sling-org-apache-sling-auth-oauth-client]

Posted by "nscendoni (via GitHub)" <gi...@apache.org>.
nscendoni merged PR #44:
URL: https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] SLING-13119 Enhance OIDC authentication with support for SP-initiated logout [sling-org-apache-sling-auth-oauth-client]

Posted by "github-advanced-security[bot] (via GitHub)" <gi...@apache.org>.
github-advanced-security[bot] commented on code in PR #44:
URL: https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44#discussion_r2919074357


##########
src/main/java/org/apache/sling/auth/oauth_client/impl/JcrUserHomeOAuthTokenStore.java:
##########
@@ -152,6 +155,74 @@
         }
     }
 
+    @Override
+    public @Nullable String getIdToken(
+            @NotNull ClientConnection connection, @NotNull Session serviceSession, @NotNull String userId)
+            throws OAuthException {
+        // Sanitize userId for safe logging (prevents log injection)
+        String safeUserId = userId.replace('\n', '_').replace('\r', '_');
+        try {

Review Comment:
   ## Logging should not be vulnerable to injection attacks
   
   <!--SONAR_ISSUE_KEY:AZzdBleJtA1YQKqeIBTD-->Change this code to not log user-controlled data. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-auth-oauth-client&issues=AZzdBleJtA1YQKqeIBTD&open=AZzdBleJtA1YQKqeIBTD&pullRequest=44">SonarQube Cloud</a></p>
   
   [Show more details](https://github.com/apache/sling-org-apache-sling-auth-oauth-client/security/code-scanning/8)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] SLING-13119 Enhance OIDC authentication with support for SP-initiated logout [sling-org-apache-sling-auth-oauth-client]

Posted by "rombert (via GitHub)" <gi...@apache.org>.
rombert commented on code in PR #44:
URL: https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44#discussion_r2974108799


##########
src/main/java/org/apache/sling/auth/oauth_client/impl/OidcLogoutHandler.java:
##########
@@ -226,50 +223,22 @@ URI getEndSessionEndpoint(@NotNull ClientConnection connection) {
     }
 
     /**
-     * Reads the id_token from the user's OAK profile using a service account, for use as id_token_hint
-     * at the IdP end_session_endpoint. The token must have been stored previously (e.g. by
-     * SlingUserInfoProcessorImpl with storeIdToken and the sync layer persisting credentials to OAK).
-     * <p>
-     * The service user configured via logoutServiceUserName must be configured in Apache Jackrabbit Oak
-     * (e.g. system users / External Principal Configuration) with minimal read-only access to user profile
-     * properties. DO NOT grant write or administrative permissions to this service user.
+     * Reads the id_token for the current user, for use as id_token_hint at the IdP end_session_endpoint.
      *
-     * @param userId the current user id (e.g. from request.getRemoteUser())
-     * @param logoutServiceUserName service user name for reading from JCR
+     * @param resolver the resource resolver for the current user
      * @param connection the resolved client connection to use with the token store
      * @return the id_token string, or null if not found or on error
      */
     @Nullable
-    String getIdTokenFromOak(
-            @NotNull String userId, @NotNull String logoutServiceUserName, @Nullable ClientConnection connection) {
-        Session serviceSession = null;
+    String getIdTokenFromOak(@Nullable ResourceResolver resolver, @Nullable ClientConnection connection) {

Review Comment:
   `getIdTokenFromTokenStore` ?



##########
src/main/java/org/apache/sling/auth/oauth_client/impl/RedisOAuthTokenStore.java:
##########
@@ -123,12 +121,8 @@ public void clearAccessToken(@NotNull ClientConnection connection, @NotNull Reso
     }
 
     @Override
-    public @Nullable String getIdToken(
-            @NotNull ClientConnection connection, @NotNull Session serviceSession, @NotNull String userId)
+    public @Nullable String getIdToken(@NotNull ClientConnection connection, @NotNull ResourceResolver resolver)
             throws OAuthException {
-        // Redis token store does not support ID token storage via service session.
-        // ID tokens are stored in JCR user profiles when using JcrUserHomeOAuthTokenStore.
-        // For Redis-based token storage, this method is not applicable and returns null.
         return null;

Review Comment:
   Is there  a particular reason not to implement this method? I think it would look exactly like the other two methods in this class.



##########
src/test/java/org/apache/sling/auth/oauth_client/InMemoryOAuthTokenStore.java:
##########
@@ -154,11 +152,8 @@ public void clearAccessToken(@NotNull ClientConnection connection, @NotNull Reso
     }
 
     @Override
-    public @Nullable String getIdToken(
-            @NotNull ClientConnection connection, @NotNull Session serviceSession, @NotNull String userId)
+    public @Nullable String getIdToken(@NotNull ClientConnection connection, @NotNull ResourceResolver resolver)
             throws OAuthException {
-        // InMemoryOAuthTokenStore does not support ID token retrieval via service session.
-        // This is only used for testing and ID tokens are not stored in this implementation.
         return null;

Review Comment:
   Like in the redis token store, any reason not to implement it?



##########
src/main/java/org/apache/sling/auth/oauth_client/impl/RedisOAuthTokenStore.java:
##########
@@ -32,7 +34,7 @@
 
 import static org.osgi.service.component.annotations.ConfigurationPolicy.REQUIRE;
 
-@Component(configurationPolicy = REQUIRE)
+@Component(configurationPolicy = REQUIRE, property = "service.ranking:Integer=100")

Review Comment:
   As commented above, I think this is no longer necessary.



##########
src/main/java/org/apache/sling/auth/oauth_client/impl/JcrUserHomeOAuthTokenStore.java:
##########
@@ -40,10 +43,7 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static org.osgi.service.component.annotations.ConfigurationPolicy.REQUIRE;
-
-// a config class is intentionally not defined, but a config is required to select an implementation
-@Component(configurationPolicy = REQUIRE)
+@Component(property = "service.ranking:Integer=0")

Review Comment:
   With your latest changes that is already addressed, right?
   
   `OidcLogoutHandler` has an optional dependency to the `TokenStore` so the service ranking/configuration policy changes can be reverted.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] SLING-13119 Enhance OIDC authentication with support for SP-initiated logout [sling-org-apache-sling-auth-oauth-client]

Posted by "rombert (via GitHub)" <gi...@apache.org>.
rombert commented on code in PR #44:
URL: https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44#discussion_r2959049213


##########
src/main/java/org/apache/sling/auth/oauth_client/impl/SlingUserInfoProcessorImpl.java:
##########
@@ -181,6 +180,21 @@ public SlingUserInfoProcessorImpl(
                     OAuthTokenStore.PROPERTY_NAME_REFRESH_TOKEN);
         }
 
+        // Store the ID Token for logout (id_token_hint at IdP end_session_endpoint)
+        // SECURITY NOTE: The ID token is encrypted before storage but increases the attack surface.
+        // Ensure proper access controls on user profile storage and rotation of encryption keys.
+        String idToken = tokens.idToken();
+        if (storeIdToken && idToken != null && !idToken.isEmpty()) {
+            try {
+                credentials.setAttribute(OAuthTokenStore.PROPERTY_NAME_ID_TOKEN, cryptoService.encrypt(idToken));

Review Comment:
   Can you please add a comment explaining that in this class? Can be a follow-up PR.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] SLING-13119 Enhance OIDC authentication with support for SP-initiated logout [sling-org-apache-sling-auth-oauth-client]

Posted by "rombert (via GitHub)" <gi...@apache.org>.
rombert commented on code in PR #44:
URL: https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44#discussion_r2959038220


##########
src/main/java/org/apache/sling/auth/oauth_client/impl/JcrUserHomeOAuthTokenStore.java:
##########
@@ -152,6 +152,74 @@ public void clearAccessToken(@NotNull ClientConnection connection, @NotNull Reso
         }
     }
 
+    @Override
+    public @Nullable String getIdToken(
+            @NotNull ClientConnection connection, @NotNull Session serviceSession, @NotNull String userId)
+            throws OAuthException {
+        // Sanitize userId for safe logging (prevents log injection)
+        String safeUserId = userId.replace('\n', '_').replace('\r', '_');

Review Comment:
   Ok, please ask for a re-review when ready.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] SLING-13119 Enhance OIDC authentication with support for SP-initiated logout [sling-org-apache-sling-auth-oauth-client]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #44:
URL: https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44#issuecomment-3992815768

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [79.2% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&metric=new_coverage&view=list) (required ≥ 80%)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] SLING-13049 Enhance OIDC authentication with support for SP-initiated logout [sling-org-apache-sling-auth-oauth-client]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #44:
URL: https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44#issuecomment-3958268991

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [50.5% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&metric=new_coverage&view=list) (required ≥ 80%)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44) (required ≥ A)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] SLING-13119 Enhance OIDC authentication with support for SP-initiated logout [sling-org-apache-sling-auth-oauth-client]

Posted by "nscendoni (via GitHub)" <gi...@apache.org>.
nscendoni commented on code in PR #44:
URL: https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44#discussion_r2923892459


##########
src/main/java/org/apache/sling/auth/oauth_client/impl/SlingUserInfoProcessorImpl.java:
##########
@@ -209,6 +266,111 @@ private String getGroupName(@NotNull String idp, Object group) {
         }
     }
 
+    @Override
+    public void cleanupUserData(@NotNull String userId) {

Review Comment:
   I removed the cleanup for id tokens. I'm not sure if this is really required.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] SLING-13119 Enhance OIDC authentication with support for SP-initiated logout [sling-org-apache-sling-auth-oauth-client]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #44:
URL: https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44#issuecomment-4045853631

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [1 New issue](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [80.6% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.3% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] SLING-13119 Enhance OIDC authentication with support for SP-initiated logout [sling-org-apache-sling-auth-oauth-client]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #44:
URL: https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44#issuecomment-4039929525

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [3 New issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [82.1% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.2% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] SLING-13119 Enhance OIDC authentication with support for SP-initiated logout [sling-org-apache-sling-auth-oauth-client]

Posted by "nscendoni (via GitHub)" <gi...@apache.org>.
nscendoni commented on code in PR #44:
URL: https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44#discussion_r2959938084


##########
src/main/java/org/apache/sling/auth/oauth_client/impl/JcrUserHomeOAuthTokenStore.java:
##########
@@ -40,10 +43,7 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static org.osgi.service.component.annotations.ConfigurationPolicy.REQUIRE;
-
-// a config class is intentionally not defined, but a config is required to select an implementation
-@Component(configurationPolicy = REQUIRE)
+@Component(property = "service.ranking:Integer=0")

Review Comment:
   OidcAuthenticatonHandler requires LogoutHandler that don't start without a configuration of OAuthTokenStore. We may modify it to have an optional reference to OAuthTokenStore.
   We need to document that the an OAuthTokenStore must be configured to enable Idp Single Log out. It may sound a bit wired without knowing the internals, but we can do that. I don't have a strong opinion on that. Do you agree with that?
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] SLING-13119 Enhance OIDC authentication with support for SP-initiated logout [sling-org-apache-sling-auth-oauth-client]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #44:
URL: https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44#issuecomment-4040139405

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [1 New issue](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [82.1% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.2% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] SLING-13049 Enhance OIDC authentication with support for SP-initiated logout [sling-org-apache-sling-auth-oauth-client]

Posted by "rombert (via GitHub)" <gi...@apache.org>.
rombert commented on code in PR #44:
URL: https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44#discussion_r2878063724


##########
src/test/java/org/apache/sling/auth/oauth_client/AuthorizationCodeFlowIT.java:
##########
@@ -335,6 +365,247 @@ void accessTokenIsPresentOnSuccessfulAuthenticationHandlerLoginWithoutPkceWithNo
         accessTokenIsPresentOnSuccessfulAuthenticationHandlerLogin(false);
     }
 
+    @Test
+    void oidcSingleLogoutRedirectsToIdpEndSessionEndpoint() throws Exception {
+        performOidcLoginWithLogoutRedirectPathAndAssertSingleLogoutRedirect(true);
+    }
+
+    void performOidcLoginWithLogoutRedirectPathAndAssertSingleLogoutRedirect(boolean withPkce) throws Exception {

Review Comment:
   Can we extend the existing OIDC test to also perform the SP-initiated logout?



##########
src/main/java/org/apache/sling/auth/oauth_client/impl/SlingUserInfoProcessorImpl.java:
##########
@@ -75,31 +90,68 @@ public class SlingUserInfoProcessorImpl implements UserInfoProcessor {
                 name = "idpNameInPrincipals",
                 description = "Add a suffix with the idp in the username and to the groups created by this processor")
         boolean idpNameInPrincipals() default false;
+
+        @AttributeDefinition(
+                name = "cleanupServiceUserName",
+                description = "Service user name for cleaning up user tokens during logout. This user must be "
+                        + "configured with read/write access to user profile properties.")
+        String cleanupServiceUserName() default DEFAULT_CLEANUP_SERVICE_USER_NAME;
+
+        @AttributeDefinition(
+                name = "enableTokenCleanup",
+                description = "Enable automatic cleanup of stored tokens during logout. When enabled, tokens "
+                        + "(access_token, refresh_token, id_token) are removed from the user profile on logout. "
+                        + "Disable this to preserve tokens for debugging, auditing, or manual cleanup. "
+                        + "Default: true")
+        boolean enableTokenCleanup() default true;
     }
 
     private static final Logger logger = LoggerFactory.getLogger(SlingUserInfoProcessorImpl.class);
+    private static final String DEFAULT_CLEANUP_SERVICE_USER_NAME = "oidc-cleanup-service";
+    private static final String PROFILE_PREFIX = "profile/";

Review Comment:
   A similar constant is introduced in OidcLogoutHandler, please keep only one.



##########
src/main/java/org/apache/sling/auth/oauth_client/spi/UserInfoProcessor.java:
##########
@@ -47,6 +47,20 @@ OidcAuthCredentials process(
             @Nullable String userInfo, @NotNull String tokenResponse, @NotNull String oidcSubject, @NotNull String idp)
             throws RuntimeException;
 
+    /**
+     * Clean up user data after logout. This method is called by the OIDC authentication handler
+     * during the logout process to remove sensitive data such as access tokens, refresh tokens,
+     * and ID tokens from persistent storage.
+     * <p>
+     * Implementations should remove stored tokens from the user's profile in the repository
+     * to ensure they cannot be reused after logout.
+     *
+     * @param userId the user identifier (e.g., from request.getRemoteUser())
+     */
+    default void cleanupUserData(@NotNull String userId) {

Review Comment:
   This might need to move/change, see my comments in SlingUserInfoProcessorImpl



##########
src/main/java/org/apache/sling/auth/oauth_client/impl/SlingUserInfoProcessorImpl.java:
##########
@@ -75,31 +90,68 @@ public class SlingUserInfoProcessorImpl implements UserInfoProcessor {
                 name = "idpNameInPrincipals",
                 description = "Add a suffix with the idp in the username and to the groups created by this processor")
         boolean idpNameInPrincipals() default false;
+
+        @AttributeDefinition(
+                name = "cleanupServiceUserName",
+                description = "Service user name for cleaning up user tokens during logout. This user must be "
+                        + "configured with read/write access to user profile properties.")
+        String cleanupServiceUserName() default DEFAULT_CLEANUP_SERVICE_USER_NAME;
+
+        @AttributeDefinition(
+                name = "enableTokenCleanup",
+                description = "Enable automatic cleanup of stored tokens during logout. When enabled, tokens "
+                        + "(access_token, refresh_token, id_token) are removed from the user profile on logout. "
+                        + "Disable this to preserve tokens for debugging, auditing, or manual cleanup. "
+                        + "Default: true")
+        boolean enableTokenCleanup() default true;
     }
 
     private static final Logger logger = LoggerFactory.getLogger(SlingUserInfoProcessorImpl.class);
+    private static final String DEFAULT_CLEANUP_SERVICE_USER_NAME = "oidc-cleanup-service";
+    private static final String PROFILE_PREFIX = "profile/";
 
     private final CryptoService cryptoService;
     private final boolean storeAccessToken;
     private final boolean storeRefreshToken;
+    private final boolean storeIdToken;
     private final boolean groupsInIdToken;
     private final String groupsClaimName;
     private final String connection;
     private final boolean idpNameInPrincipals;
+    private final String cleanupServiceUserName;
+    private final boolean enableTokenCleanup;
+    private final SlingRepository repository;
 
     @Activate
     public SlingUserInfoProcessorImpl(
-            @Reference(policyOption = ReferencePolicyOption.GREEDY) CryptoService service, Config config) {
+            @Reference(policyOption = ReferencePolicyOption.GREEDY) CryptoService service,
+            @Reference(cardinality = ReferenceCardinality.OPTIONAL, policyOption = ReferencePolicyOption.GREEDY)

Review Comment:
   What is the reason for making the SlingRepository reference optional?



##########
src/main/java/org/apache/sling/auth/oauth_client/impl/SlingUserInfoProcessorImpl.java:
##########
@@ -209,6 +266,111 @@ private String getGroupName(@NotNull String idp, Object group) {
         }
     }
 
+    @Override
+    public void cleanupUserData(@NotNull String userId) {

Review Comment:
   Why did you choose to implement the cleanup logic here? We have all the persistence handled in the OAuthTokenStore (and sub-classes).
   
   This is also tying the cleanup logic to JCR only and I think makes the UserInfoProcessor have too many responsibilities.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] SLING-13119 Enhance OIDC authentication with support for SP-initiated logout [sling-org-apache-sling-auth-oauth-client]

Posted by "nscendoni (via GitHub)" <gi...@apache.org>.
nscendoni commented on PR #44:
URL: https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44#issuecomment-4156268714

   I applied the requested changes, I removed duplicated tests and did a refactor to make them be more readable.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] SLING-13119 Enhance OIDC authentication with support for SP-initiated logout [sling-org-apache-sling-auth-oauth-client]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #44:
URL: https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44#issuecomment-4039116955

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [65.1% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&metric=new_coverage&view=list) (required ≥ 80%)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [B Security Rating on New Code](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44) (required ≥ A)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] SLING-13119 Enhance OIDC authentication with support for SP-initiated logout [sling-org-apache-sling-auth-oauth-client]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #44:
URL: https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44#issuecomment-4098204348

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [2 New issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [80.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.3% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] SLING-13119 Enhance OIDC authentication with support for SP-initiated logout [sling-org-apache-sling-auth-oauth-client]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #44:
URL: https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44#issuecomment-4162364720

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [80.8% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.3% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] SLING-13119 Enhance OIDC authentication with support for SP-initiated logout [sling-org-apache-sling-auth-oauth-client]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #44:
URL: https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44#issuecomment-4156167274

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [7 New issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [80.6% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.3% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] SLING-13119 Enhance OIDC authentication with support for SP-initiated logout [sling-org-apache-sling-auth-oauth-client]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #44:
URL: https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44#issuecomment-4045587473

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [1 New issue](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [80.6% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.3% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] SLING-13119 Enhance OIDC authentication with support for SP-initiated logout [sling-org-apache-sling-auth-oauth-client]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #44:
URL: https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44#issuecomment-4045467069

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [1 New issue](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [80.6% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.3% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] SLING-13119 Enhance OIDC authentication with support for SP-initiated logout [sling-org-apache-sling-auth-oauth-client]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #44:
URL: https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44#issuecomment-4161693143

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [80.8% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.3% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-auth-oauth-client&pullRequest=44)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] SLING-13119 Enhance OIDC authentication with support for SP-initiated logout [sling-org-apache-sling-auth-oauth-client]

Posted by "rombert (via GitHub)" <gi...@apache.org>.
rombert commented on code in PR #44:
URL: https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44#discussion_r2959047541


##########
src/main/java/org/apache/sling/auth/oauth_client/impl/JcrUserHomeOAuthTokenStore.java:
##########
@@ -40,10 +43,7 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static org.osgi.service.component.annotations.ConfigurationPolicy.REQUIRE;
-
-// a config class is intentionally not defined, but a config is required to select an implementation
-@Component(configurationPolicy = REQUIRE)
+@Component(property = "service.ranking:Integer=0")

Review Comment:
   I think it's problematic to have multiple references around, especially if consumers don't properly bind to the right one.
   
   What problem did you encounter with the current pattern of requiring a configuration to activate token stores?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] SLING-13119 Enhance OIDC authentication with support for SP-initiated logout [sling-org-apache-sling-auth-oauth-client]

Posted by "nscendoni (via GitHub)" <gi...@apache.org>.
nscendoni commented on code in PR #44:
URL: https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44#discussion_r2959938084


##########
src/main/java/org/apache/sling/auth/oauth_client/impl/JcrUserHomeOAuthTokenStore.java:
##########
@@ -40,10 +43,7 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static org.osgi.service.component.annotations.ConfigurationPolicy.REQUIRE;
-
-// a config class is intentionally not defined, but a config is required to select an implementation
-@Component(configurationPolicy = REQUIRE)
+@Component(property = "service.ranking:Integer=0")

Review Comment:
   OidcAuthenticatonHandler requires LogoutHandler that don't start without a configuration of OAuthTokenStore. We may modify it to have an optional reference to OAuthTokenStore.
   We need to document that the an OAuthTokenStore must be configured to enable Idp Single Log out. It may sound a bit wired without knowing the internals, but we can do that. I don't have a strong opinion on that...
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org