Class AbstractGetTokenAction
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.acting.AbstractAction
org.apache.cocoon.acting.ServiceableAction
org.ametys.plugins.mobileapp.action.AbstractGetTokenAction
- All Implemented Interfaces:
Component,LogEnabled,Serviceable,ThreadSafe,Action
- Direct Known Subclasses:
GetTokenFromFormAction,GetTokenFromOIDCAction
Returns the token for a user (only to be used by the mobile app on one site)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AuthenticationTokenManagerAuthentication Token Managerprotected CurrentUserProviderThe current user providerprotected JSONUtilsJSON Utilsprotected PopulationContextHelperThe helper for the associations population/contextprotected UserPopulationDAOThe user population DAOFields inherited from class org.apache.cocoon.acting.ServiceableAction
managerFields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionact(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) protected ObjectGet a parameter from the mobile app, either from the request body or a request parametervoidservice(ServiceManager smanager) protected abstract UserIdentitytryConnect(Map<String, Object> params, Request request, String context, UserPopulation userPopulation, CredentialProvider credentialProvider, int credentialProviderIndex) Try to authenticate the current mobile userMethods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
_authenticationTokenManager
Authentication Token Manager -
_userPopulationDAO
The user population DAO -
_populationContextHelper
The helper for the associations population/context -
_currentUserProvider
The current user provider -
_jsonUtils
JSON Utils
-
-
Constructor Details
-
AbstractGetTokenAction
public AbstractGetTokenAction()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classServiceableAction- Throws:
ServiceException
-
act
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception -
getParameter
Get a parameter from the mobile app, either from the request body or a request parameter- Parameters:
name- the parameter namejsonParams- the decoded JSON request body, if anyrequest- the request- Returns:
- the parameter value, or null if not found
-
tryConnect
protected abstract UserIdentity tryConnect(Map<String, Object> params, Request request, String context, UserPopulation userPopulation, CredentialProvider credentialProvider, int credentialProviderIndex) Try to authenticate the current mobile user- Parameters:
params- the parameters issued by the mobile apprequest- the authentication requestcontext- the population contextuserPopulation- the populationcredentialProvider- theCredentialProvidercredentialProviderIndex- the index of the credentialProvider in the given userPopulation- Returns:
- the authenticated user, if any
-