Annotation Interface RequiresAuth


@Retention(RUNTIME) @Target(TYPE) @Inherited public @interface RequiresAuth
Indicates that a page requires an authenticated user.

When applied to a page class, the Oorian framework will invoke the registered SecurityHandler to verify that the current user is authenticated before allowing access. If no user is authenticated, the framework redirects to the login page configured via Application.setLoginPage(String), preserving the original URL so the user can be redirected back after successful authentication. If no login page is configured, a 401 Unauthorized response is returned.

Usage:


 @Page("/dashboard")
 @RequiresAuth
 public class DashboardPage extends HtmlPage { }
 

The annotation is inherited, so a base page annotated with @RequiresAuth will protect all its subclasses as well.

Since:
2.1
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also: