diff --git a/federation/sssd/src/main/java/org/keycloak/federation/sssd/api/SSSDException.java b/federation/sssd/src/main/java/org/keycloak/federation/sssd/api/SSSDException.java
new file mode 100644
index 0000000000..c03c9263a4
--- /dev/null
+++ b/federation/sssd/src/main/java/org/keycloak/federation/sssd/api/SSSDException.java
@@ -0,0 +1,17 @@
+package org.keycloak.federation.sssd.api;
+
+/**
+ * @author Bruno Oliveira
+ */
+public class SSSDException extends RuntimeException {
+ public SSSDException() {
+ }
+
+ public SSSDException(String message) {
+ super(message);
+ }
+
+ public SSSDException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
diff --git a/federation/sssd/src/main/java/org/keycloak/federation/sssd/api/Sssd.java b/federation/sssd/src/main/java/org/keycloak/federation/sssd/api/Sssd.java
index 5d62ce4ba7..9cfee78daa 100644
--- a/federation/sssd/src/main/java/org/keycloak/federation/sssd/api/Sssd.java
+++ b/federation/sssd/src/main/java/org/keycloak/federation/sssd/api/Sssd.java
@@ -94,19 +94,19 @@ public class Sssd {
InfoPipe infoPipe = infopipe();
attributes = infoPipe.getUserAttributes(username, Arrays.asList(attr));
} catch (Exception e) {
- logger.error("Failed to retrieve user's attributes from SSSD", e);
+ throw new SSSDException("Failed to retrieve user's attributes. Check if SSSD service is active.");
}
return attributes;
}
public List getUserGroups() {
- List userGroups = null;
+ List userGroups;
try {
InfoPipe infoPipe = Sssd.infopipe();
userGroups = infoPipe.getUserGroups(username);
} catch (Exception e) {
- logger.error("Failed to retrieve user's groups from SSSD", e);
+ throw new SSSDException("Failed to retrieve user's groups from SSSD. Check if SSSD service is active.");
}
return userGroups;
}