Class TextIdentityProviderPlugin
- java.lang.Object
-
- io.vertigo.account.plugins.identityprovider.text.TextIdentityProviderPlugin
-
- All Implemented Interfaces:
IdentityProviderPlugin,io.vertigo.core.node.component.Activeable,io.vertigo.core.node.component.CoreComponent,io.vertigo.core.node.component.Plugin
public class TextIdentityProviderPlugin extends Object implements IdentityProviderPlugin, io.vertigo.core.node.component.Activeable
A simple implementation of the Realm interface that uses a set of configured user accounts and roles to support authentication and authorization. Each account entry specifies the username, password, and roles for a user. Roles can also be mapped to permissions and associated with users. User accounts and roles are stored in twoMaps in memory, so it is expected that the total number of either is not sufficiently large.- Since:
- 0.1
-
-
Constructor Summary
Constructors Constructor Description TextIdentityProviderPlugin(String filePath, String filePatternStr, String userAuthField, String userIdentityEntity, io.vertigo.core.resource.ResourceManager resourceManager, io.vertigo.datamodel.smarttype.SmartTypeManager smartTypeManager)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <E extends io.vertigo.datamodel.structure.model.Entity>
List<E>getAllUsers()<E extends io.vertigo.datamodel.structure.model.Entity>
Optional<VFile>getPhoto(io.vertigo.datamodel.structure.model.UID<E> accountURI)Gets the photo of an account defined by its URI.<E extends io.vertigo.datamodel.structure.model.Entity>
EgetUserByAuthToken(String userAuthToken)Gets an newly authentified account by his authToken.longgetUsersCount()voidstart()voidstop()
-
-
-
Constructor Detail
-
TextIdentityProviderPlugin
@Inject public TextIdentityProviderPlugin(String filePath, String filePatternStr, String userAuthField, String userIdentityEntity, io.vertigo.core.resource.ResourceManager resourceManager, io.vertigo.datamodel.smarttype.SmartTypeManager smartTypeManager)
Constructor.- Parameters:
resourceManager- Resource ManagerfilePath- File pathfilePatternStr- File Pattern (id, displayName, email, authToken, photoUrl)userAuthField- Authent token field nameuserIdentityEntity- User dtDefinition name
-
-
Method Detail
-
getUsersCount
public long getUsersCount()
- Specified by:
getUsersCountin interfaceIdentityProviderPlugin- Returns:
- the number of accounts
-
getAllUsers
public <E extends io.vertigo.datamodel.structure.model.Entity> List<E> getAllUsers()
- Specified by:
getAllUsersin interfaceIdentityProviderPlugin- Type Parameters:
E- project's User entity type- Returns:
- all users
-
getUserByAuthToken
public <E extends io.vertigo.datamodel.structure.model.Entity> E getUserByAuthToken(String userAuthToken)
Gets an newly authentified account by his authToken.- Specified by:
getUserByAuthTokenin interfaceIdentityProviderPlugin- Type Parameters:
E- project's User entity type- Parameters:
userAuthToken- user authToken- Returns:
- Logged account
-
getPhoto
public <E extends io.vertigo.datamodel.structure.model.Entity> Optional<VFile> getPhoto(io.vertigo.datamodel.structure.model.UID<E> accountURI)
Gets the photo of an account defined by its URI.- Specified by:
getPhotoin interfaceIdentityProviderPlugin- Type Parameters:
E- project's User entity type- Parameters:
accountURI- the account defined by its URI- Returns:
- the photo as a file
-
start
public void start()
- Specified by:
startin interfaceio.vertigo.core.node.component.Activeable
-
stop
public void stop()
- Specified by:
stopin interfaceio.vertigo.core.node.component.Activeable
-
-