Package org.dspace.app.rest.security
Class DSpaceAuthentication
java.lang.Object
org.dspace.app.rest.security.DSpaceAuthentication
- All Implemented Interfaces:
Serializable,Principal,org.springframework.security.core.Authentication
public class DSpaceAuthentication
extends Object
implements org.springframework.security.core.Authentication
Custom Authentication for use with DSpace
- Author:
- Frederic Van Reet (frederic dot vanreet at atmire dot com), Tom Desair (tom dot desair at atmire dot com)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a temporary, empty DSpaceAuthentication instance which may be used to trigger an implicit authentication.DSpaceAuthentication(String username, String password) Create a temporary DSpaceAuthentication instance which may be used to store information about the user who will be attempting authentication.DSpaceAuthentication(EPerson ePerson, List<org.springframework.security.core.GrantedAuthority> authorities) Create a DSpaceAuthentication instance for an already authenticated EPerson, including their GrantedAuthority objects. -
Method Summary
Modifier and TypeMethodDescriptionCollection<? extends org.springframework.security.core.GrantedAuthority>getName()booleanvoidsetAuthenticated(boolean authenticated)
-
Constructor Details
-
DSpaceAuthentication
public DSpaceAuthentication(EPerson ePerson, List<org.springframework.security.core.GrantedAuthority> authorities) Create a DSpaceAuthentication instance for an already authenticated EPerson, including their GrantedAuthority objects.NOTE: This type of DSpaceAuthentication object is returned to Spring after a successful authentication.
- Parameters:
ePerson- authenticated EPersonauthorities- EPerson's authorities
-
DSpaceAuthentication
Create a temporary DSpaceAuthentication instance which may be used to store information about the user who will be attempting authentication.NOTE: This type of DSpaceAuthentication object is used to attempt a new authentication in DSpace. It is therefore temporary in nature, as it will be discarded after successful authentication.
- Parameters:
username- username to attempt authentication forpassword- password to use for authentication
-
DSpaceAuthentication
public DSpaceAuthentication()Create a temporary, empty DSpaceAuthentication instance which may be used to trigger an implicit authentication. An example is Shibboleth, as this doesn't require an explicit username/password, as the user will have been authenticated externally, and DSpace just needs to perform an implicit authentication by looking for the auth data passed to it by Shibboleth.
-
-
Method Details
-
getAuthorities
- Specified by:
getAuthoritiesin interfaceorg.springframework.security.core.Authentication
-
getCredentials
- Specified by:
getCredentialsin interfaceorg.springframework.security.core.Authentication
-
getDetails
- Specified by:
getDetailsin interfaceorg.springframework.security.core.Authentication
-
getPrincipal
- Specified by:
getPrincipalin interfaceorg.springframework.security.core.Authentication
-
isAuthenticated
public boolean isAuthenticated()- Specified by:
isAuthenticatedin interfaceorg.springframework.security.core.Authentication
-
setAuthenticated
- Specified by:
setAuthenticatedin interfaceorg.springframework.security.core.Authentication- Throws:
IllegalArgumentException
-
getName
-
getPreviousLoginDate
-