File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
core/src/main/java/org/seedstack/seed/security/internal
specs/src/main/java/org/seedstack/seed/security Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,13 @@ public SimplePrincipalProvider getSimplePrincipalByName(String principalName) {
8282 public boolean isAuthenticated () {
8383 return SecurityUtils .getSubject ().isAuthenticated ();
8484 }
85+
86+ @ Override
87+ public boolean isRememberedAuthentication () {
88+ Subject subject = SecurityUtils .getSubject ();
89+ return subject .isAuthenticated () || subject .isRemembered ();
90+ }
91+
8592
8693 @ Override
8794 public boolean isPermitted (String permission ) {
@@ -246,4 +253,6 @@ public String getHost() {
246253 }
247254 return s .getHost ();
248255 }
256+
257+
249258}
Original file line number Diff line number Diff line change @@ -235,10 +235,21 @@ public interface SecuritySupport {
235235 /**
236236 * Check if the current user is authenticated.
237237 *
238+ * Authenticated on Shiro means that subject has successfully logged in on the current session
239+ * @see org.seedstack.seed.security.SecuritySupport#isRememberedAuthentication()
240+ *
238241 * @return true if authenticated, false otherwise.
239242 */
240243 boolean isAuthenticated ();
241244
245+
246+ /**
247+ * Checks if the current user has logged successfully on a previous session
248+ *
249+ * @return true if remembered, false otherwise.
250+ */
251+ boolean isRememberedAuthentication ();
252+
242253 /**
243254 * Returns the host name or IP string of the host of the connected user, or {@code null} if the host is unknown.
244255 *
You can’t perform that action at this time.
0 commit comments