Package org.pac4j.core.engine
Class DefaultCallbackLogic<R,C extends WebContext>
- java.lang.Object
-
- org.pac4j.core.profile.factory.ProfileManagerFactoryAware<C>
-
- org.pac4j.core.engine.AbstractExceptionAwareLogic<R,C>
-
- org.pac4j.core.engine.DefaultCallbackLogic<R,C>
-
- All Implemented Interfaces:
CallbackLogic<R,C>
public class DefaultCallbackLogic<R,C extends WebContext> extends AbstractExceptionAwareLogic<R,C> implements CallbackLogic<R,C>
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()
R
perform(C context, Config config, HttpActionAdapter<R,C> httpActionAdapter, String inputDefaultUrl, Boolean inputSaveInSession, Boolean inputMultiProfile, Boolean inputRenewSession, String client)
Perform the callback logic.protected HttpAction
redirectToOriginallyRequestedUrl(C context, String defaultUrl)
protected void
renewSession(C context, Config config)
protected void
saveUserProfile(C context, Config config, UserProfile profile, boolean saveInSession, boolean multiProfile, boolean renewSession)
void
setClientFinder(ClientFinder clientFinder)
void
setSavedRequestHandler(SavedRequestHandler savedRequestHandler)
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 R perform(C context, Config config, HttpActionAdapter<R,C> httpActionAdapter, String inputDefaultUrl, Boolean inputSaveInSession, Boolean inputMultiProfile, Boolean inputRenewSession, String client)
Description copied from interface:CallbackLogic
Perform the callback logic.- Specified by:
perform
in interfaceCallbackLogic<R,C extends WebContext>
- Parameters:
context
- the web contextconfig
- the security configurationhttpActionAdapter
- the HTTP action adapterinputDefaultUrl
- the default urlinputSaveInSession
- whether profile should be saved in sessioninputMultiProfile
- whether multi profiles are supportedinputRenewSession
- whether the session must be renewedclient
- the default client- Returns:
- the resulting action of the callback
-
saveUserProfile
protected void saveUserProfile(C context, Config config, UserProfile profile, boolean saveInSession, boolean multiProfile, boolean renewSession)
-
redirectToOriginallyRequestedUrl
protected HttpAction redirectToOriginallyRequestedUrl(C context, String defaultUrl)
-
getClientFinder
public ClientFinder getClientFinder()
-
setClientFinder
public void setClientFinder(ClientFinder clientFinder)
-
getSavedRequestHandler
public SavedRequestHandler getSavedRequestHandler()
-
setSavedRequestHandler
public void setSavedRequestHandler(SavedRequestHandler savedRequestHandler)
-
-