Class ConnectPrincipalServiceImpl
java.lang.Object
ch.tocco.nice2.optional.sso.impl.actions.ConnectPrincipalServiceImpl
- All Implemented Interfaces:
ConnectPrincipalService
@Component
public class ConnectPrincipalServiceImpl
extends Object
implements ConnectPrincipalService
-
Constructor Summary
ConstructorDescriptionConnectPrincipalServiceImpl
(Context context, PrincipalManager principalManager, QueryBuilderFactory queryBuilderFactory, SecurityManager securityManager, BusinessUnitManager businessUnitManager) -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkAccessRights
(Entity principal) The action may only be run as usermanager or for the own principal (username of the selected principal = current username) If the action is called for a different username without usermanager role anUnauthorizedException
is thrown.void
connectPrincipal
(Entity principal, String provider, String ssoSubject) writes sso_subject and provider to the selected principalvoid
disconnectPrincipal
(Entity principal) remove sso_subject and provider from the selected principalboolean
isAlreadyUsed
(String provider, String ssoSubject) sso_subject / provider combinations must be unique, this method may be used to check whether the given combination is already used or not.boolean
isConnected
(Entity principal) checks if a principal is already connected with a provider
-
Constructor Details
-
ConnectPrincipalServiceImpl
public ConnectPrincipalServiceImpl(Context context, PrincipalManager principalManager, QueryBuilderFactory queryBuilderFactory, SecurityManager securityManager, BusinessUnitManager businessUnitManager)
-
-
Method Details
-
checkAccessRights
Description copied from interface:ConnectPrincipalService
The action may only be run as usermanager or for the own principal (username of the selected principal = current username) If the action is called for a different username without usermanager role anUnauthorizedException
is thrown.- Specified by:
checkAccessRights
in interfaceConnectPrincipalService
-
isAlreadyUsed
Description copied from interface:ConnectPrincipalService
sso_subject / provider combinations must be unique, this method may be used to check whether the given combination is already used or not.- Specified by:
isAlreadyUsed
in interfaceConnectPrincipalService
-
connectPrincipal
Description copied from interface:ConnectPrincipalService
writes sso_subject and provider to the selected principal- Specified by:
connectPrincipal
in interfaceConnectPrincipalService
-
isConnected
Description copied from interface:ConnectPrincipalService
checks if a principal is already connected with a provider- Specified by:
isConnected
in interfaceConnectPrincipalService
-
disconnectPrincipal
Description copied from interface:ConnectPrincipalService
remove sso_subject and provider from the selected principal- Specified by:
disconnectPrincipal
in interfaceConnectPrincipalService
-