Class DefaultCallbackLogic

java.lang.Object
org.pac4j.core.engine.AbstractExceptionAwareLogic
org.pac4j.core.engine.DefaultCallbackLogic
All Implemented Interfaces:
CallbackLogic

public class DefaultCallbackLogic extends AbstractExceptionAwareLogic implements CallbackLogic

Default callback logic:

The credentials are extracted from the current request to fetch the user profile (from the identity provider) which is then saved in the web session. Finally, the user is redirected back to the originally requested url (or to the defaultUrl).

Since:
1.9.0
Author:
Jerome Leleu
  • Field Details

  • Constructor Details

    • DefaultCallbackLogic

      public DefaultCallbackLogic()
  • Method Details

    • perform

      public Object perform(Config config, String inputDefaultUrl, Boolean inputRenewSession, String defaultClient, FrameworkParameters parameters)
      Perform the callback logic.
      Specified by:
      perform in interface CallbackLogic
      Parameters:
      config - the security configuration
      inputDefaultUrl - the default url
      inputRenewSession - whether the session must be renewed
      defaultClient - the default client
      parameters - framework parameters
      Returns:
      the resulting action of the callback
    • saveUserProfile

      protected void saveUserProfile(CallContext ctx, Config config, UserProfile profile, boolean saveProfileInSession, boolean multiProfile, boolean renewSession)

      saveUserProfile.

      Parameters:
      ctx - a CallContext object
      config - a Config object
      profile - a UserProfile object
      saveProfileInSession - a boolean
      multiProfile - a boolean
      renewSession - a boolean
    • renewSession

      protected void renewSession(CallContext ctx, Config config)

      renewSession.

      Parameters:
      ctx - a CallContext object
      config - a Config object
    • redirectToOriginallyRequestedUrl

      protected HttpAction redirectToOriginallyRequestedUrl(CallContext ctx, String defaultUrl)

      redirectToOriginallyRequestedUrl.

      Parameters:
      ctx - a CallContext object
      defaultUrl - a String object
      Returns:
      a HttpAction object