Package org.pac4j.core.engine
Class DefaultCallbackLogic
- java.lang.Object
-
- org.pac4j.core.profile.factory.ProfileManagerFactoryAware
-
- 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 Summary
Fields Modifier and Type Field Description static DefaultCallbackLogic
INSTANCE
-
Constructor Summary
Constructors Constructor Description DefaultCallbackLogic()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClientFinder
getClientFinder()
SavedRequestHandler
getSavedRequestHandler()
java.lang.Object
perform(WebContext webContext, SessionStore sessionStore, Config config, HttpActionAdapter httpActionAdapter, java.lang.String inputDefaultUrl, java.lang.Boolean inputRenewSession, java.lang.String defaultClient)
Perform the callback logic.protected HttpAction
redirectToOriginallyRequestedUrl(WebContext context, SessionStore sessionStore, java.lang.String defaultUrl)
protected void
renewSession(WebContext context, SessionStore sessionStore, Config config)
protected void
saveUserProfile(WebContext context, SessionStore sessionStore, Config config, UserProfile profile, boolean saveProfileInSession, boolean multiProfile, boolean renewSession)
void
setClientFinder(ClientFinder clientFinder)
void
setSavedRequestHandler(SavedRequestHandler savedRequestHandler)
java.lang.String
toString()
-
Methods inherited from class org.pac4j.core.engine.AbstractExceptionAwareLogic
getErrorUrl, handleException, runtimeException, setErrorUrl
-
Methods inherited from class org.pac4j.core.profile.factory.ProfileManagerFactoryAware
getProfileManager, getProfileManagerFactory, setProfileManagerFactory
-
-
-
-
Field Detail
-
INSTANCE
public static final DefaultCallbackLogic INSTANCE
-
-
Method Detail
-
perform
public java.lang.Object perform(WebContext webContext, SessionStore sessionStore, Config config, HttpActionAdapter httpActionAdapter, java.lang.String inputDefaultUrl, java.lang.Boolean inputRenewSession, java.lang.String defaultClient)
Description copied from interface:CallbackLogic
Perform the callback logic.- Specified by:
perform
in interfaceCallbackLogic
- Parameters:
webContext
- the web contextsessionStore
- the session storeconfig
- the security configurationhttpActionAdapter
- the HTTP action adapterinputDefaultUrl
- the default urlinputRenewSession
- whether the session must be reneweddefaultClient
- the default client- Returns:
- the resulting action of the callback
-
saveUserProfile
protected void saveUserProfile(WebContext context, SessionStore sessionStore, Config config, UserProfile profile, boolean saveProfileInSession, boolean multiProfile, boolean renewSession)
-
renewSession
protected void renewSession(WebContext context, SessionStore sessionStore, Config config)
-
redirectToOriginallyRequestedUrl
protected HttpAction redirectToOriginallyRequestedUrl(WebContext context, SessionStore sessionStore, java.lang.String defaultUrl)
-
getClientFinder
public ClientFinder getClientFinder()
-
setClientFinder
public void setClientFinder(ClientFinder clientFinder)
-
getSavedRequestHandler
public SavedRequestHandler getSavedRequestHandler()
-
setSavedRequestHandler
public void setSavedRequestHandler(SavedRequestHandler savedRequestHandler)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-