You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2021/05/17 14:25:41 UTC

[sling-org-apache-sling-auth-core] 02/03: SLING-10383 - Do not check for redirect loops when a login fails due to an expired token

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch feature/SLING-10383
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-auth-core.git

commit daf40c2fe96293c9e6e54aed10e6736e7bb14c34
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Mon May 17 16:22:12 2021 +0200

    SLING-10383 - Do not check for redirect loops when a login fails due to an expired token
    
    Expose a new failure reason for expired tokens.
---
 pom.xml                                                        |  6 ++++++
 .../org/apache/sling/auth/core/spi/AuthenticationHandler.java  | 10 +++++++++-
 src/main/java/org/apache/sling/auth/core/spi/package-info.java |  4 ++--
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index c8bd88b..59ed2c6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -73,6 +73,12 @@
             <artifactId>org.osgi.service.component</artifactId>
         </dependency>
         <dependency>
+            <groupId>biz.aQute.bnd</groupId>
+            <artifactId>biz.aQute.bnd.annotation</artifactId>
+            <version>5.3.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.api</artifactId>
             <version>2.20.0</version>
diff --git a/src/main/java/org/apache/sling/auth/core/spi/AuthenticationHandler.java b/src/main/java/org/apache/sling/auth/core/spi/AuthenticationHandler.java
index 35a5ab4..2816110 100644
--- a/src/main/java/org/apache/sling/auth/core/spi/AuthenticationHandler.java
+++ b/src/main/java/org/apache/sling/auth/core/spi/AuthenticationHandler.java
@@ -25,6 +25,8 @@ import javax.servlet.http.HttpServletResponse;
 
 import org.osgi.annotation.versioning.ConsumerType;
 
+import aQute.bnd.annotation.baseline.BaselineIgnore;
+
 /**
  * The <code>AuthenticationHandler</code> interface defines the service API used
  * by the authentication implementation to support plugin various ways of
@@ -116,16 +118,22 @@ public interface AuthenticationHandler {
      *     change initial password is enabled</li>
      *     <li><code>account_locked</code>: the account was disabled or locked</li>
      *     <li><code>account_not_found</code>: the account was not found (not the same as username password mismatch)</li>
+     *     <li><code>expired_token</code>: the token credentials used have expired</li>
      * </ul>
      * @since 1.1.0
      */
+    // When adding a new field to the enum bnd will require a minor version bump
+    // That's unfortunately too much for an SPI package and should really have no impact
+    // on implementors since the enum values are not exposed from any public API
+    @BaselineIgnore("1.2.3")
     enum FAILURE_REASON_CODES {
         INVALID_LOGIN,
         PASSWORD_EXPIRED,
         PASSWORD_EXPIRED_AND_NEW_PASSWORD_IN_HISTORY,
         UNKNOWN,
         ACCOUNT_LOCKED,
-        ACCOUNT_NOT_FOUND;
+        ACCOUNT_NOT_FOUND,
+        EXPIRED_TOKEN;
 
         @Override
         public String toString() {
diff --git a/src/main/java/org/apache/sling/auth/core/spi/package-info.java b/src/main/java/org/apache/sling/auth/core/spi/package-info.java
index b6428ba..7171d7f 100755
--- a/src/main/java/org/apache/sling/auth/core/spi/package-info.java
+++ b/src/main/java/org/apache/sling/auth/core/spi/package-info.java
@@ -26,9 +26,9 @@
  * being an abstract base implementation from which concrete
  * implementations may inherit.
  *
- * @version 1.2.2
+ * @version 1.2.3
  */
-@org.osgi.annotation.versioning.Version("1.2.2")
+@org.osgi.annotation.versioning.Version("1.2.3")
 package org.apache.sling.auth.core.spi;