Class Identified

java.lang.Object
rife.authentication.elements.Identified
All Implemented Interfaces:
Element
Direct Known Subclasses:
Authenticated, Login

public class Identified extends Object implements Element
Tries to identify a user and store that as a request attribute.

This element can be used to customize to behavior when a user is logged in, without requiring authentication for guests.

Since:
1.0
See Also:
  • Constructor Details

    • Identified

      protected Identified()
      This constructor is meant to be used when extending the Identified element with your custom identification class.

      Don't forget to also override the `getAuthConfig()` methods.

      Since:
      1.0
    • Identified

      public Identified(AuthConfig config)
      This constructor is meant to be used when the Identified element is used directly as a route in your site.

      When extending this element, use the default constructor instead and override the `getAuthConfig()` method.

      Parameters:
      config - the auth config to use
      Since:
      1.0
  • Method Details

    • getIdentifiedElementInRequest

      public static Identified getIdentifiedElementInRequest(Context c)
      Retrieve the Identified element instance that is active in this request.
      Parameters:
      c - the processing context that will be used for the lookup
      Returns:
      this request's identified element instance; or null if it can't be found
      Since:
      1.0
    • initializeIdentified

      protected void initializeIdentified(Context c)
      Hook method that is called at the start of the element's processing.
      Parameters:
      c - the element processing context
      Since:
      1.0
    • getAuthConfig

      public AuthConfig getAuthConfig()
      Hook method that is called to retrieve the AuthConfig to use.
      Returns:
      the config to use for authentication
      Since:
      1.0
    • process

      public void process(Context c) throws Exception
      Description copied from interface: Element
      Process the provided Context with this element.
      Specified by:
      process in interface Element
      Parameters:
      c - the provided request/response context
      Throws:
      Exception - when an error occurs
    • setIdentityAttribute

      public void setIdentityAttribute(Context c)
    • getIdentity

      public RoleUserIdentity getIdentity(Context c)