mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-10 11:33:11 +00:00
auth service allocation
This commit is contained in:
@@ -77,7 +77,6 @@ public class ShibAuthentication implements AuthenticationMethod
|
|||||||
/** Maximum length for eperson additional metadata fields **/
|
/** Maximum length for eperson additional metadata fields **/
|
||||||
protected final int METADATA_MAX_SIZE = 1024;
|
protected final int METADATA_MAX_SIZE = 1024;
|
||||||
|
|
||||||
protected AuthenticationService authenticationService = AuthenticateServiceFactory.getInstance().getAuthenticationService();
|
|
||||||
protected EPersonService ePersonService = EPersonServiceFactory.getInstance().getEPersonService();
|
protected EPersonService ePersonService = EPersonServiceFactory.getInstance().getEPersonService();
|
||||||
protected GroupService groupService = EPersonServiceFactory.getInstance().getGroupService();
|
protected GroupService groupService = EPersonServiceFactory.getInstance().getGroupService();
|
||||||
protected MetadataFieldService metadataFieldService = ContentServiceFactory.getInstance().getMetadataFieldService();
|
protected MetadataFieldService metadataFieldService = ContentServiceFactory.getInstance().getMetadataFieldService();
|
||||||
@@ -226,7 +225,7 @@ public class ShibAuthentication implements AuthenticationMethod
|
|||||||
// Step 4: Log the user in.
|
// Step 4: Log the user in.
|
||||||
context.setCurrentUser(eperson);
|
context.setCurrentUser(eperson);
|
||||||
request.getSession().setAttribute("shib.authenticated", true);
|
request.getSession().setAttribute("shib.authenticated", true);
|
||||||
authenticationService.initEPerson(context, request, eperson);
|
AuthenticateServiceFactory.getInstance().getAuthenticationService().initEPerson(context, request, eperson);
|
||||||
|
|
||||||
log.info(eperson.getEmail()+" has been authenticated via shibboleth.");
|
log.info(eperson.getEmail()+" has been authenticated via shibboleth.");
|
||||||
return AuthenticationMethod.SUCCESS;
|
return AuthenticationMethod.SUCCESS;
|
||||||
@@ -730,7 +729,7 @@ public class ShibAuthentication implements AuthenticationMethod
|
|||||||
eperson.setCanLogIn(true);
|
eperson.setCanLogIn(true);
|
||||||
|
|
||||||
// Commit the new eperson
|
// Commit the new eperson
|
||||||
authenticationService.initEPerson(context, request, eperson);
|
AuthenticateServiceFactory.getInstance().getAuthenticationService().initEPerson(context, request, eperson);
|
||||||
ePersonService.update(context, eperson);
|
ePersonService.update(context, eperson);
|
||||||
context.dispatchEvents();
|
context.dispatchEvents();
|
||||||
|
|
||||||
@@ -880,7 +879,7 @@ public class ShibAuthentication implements AuthenticationMethod
|
|||||||
|
|
||||||
else if (ePersonService.checkPassword(context, eperson, password)) {
|
else if (ePersonService.checkPassword(context, eperson, password)) {
|
||||||
// Password matched
|
// Password matched
|
||||||
authenticationService.initEPerson(context, request, eperson);
|
AuthenticateServiceFactory.getInstance().getAuthenticationService().initEPerson(context, request, eperson);
|
||||||
context.setCurrentUser(eperson);
|
context.setCurrentUser(eperson);
|
||||||
log.info(eperson.getEmail()+" has been authenticated via shibboleth using password-based sword compatibility mode.");
|
log.info(eperson.getEmail()+" has been authenticated via shibboleth using password-based sword compatibility mode.");
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
|
Reference in New Issue
Block a user