Hi Jose.
To accomplish the same thing in 6.3, I had to add two new methods to dspace-api/src/main/java/org/dspace/authenticate/AuthenticationServiceImpl.java:
Line 74
@Override
public int authenticateSword(Context context, String un, String pw, String realm, HttpServletRequest request) {
PasswordAuthentication AuthenticationMethod = new PasswordAuthentication();
// better is lowest, so start with the highest.
int bestRet = PasswordAuthentication.BAD_ARGS;
// return on first success, otherwise "best" outcome.
int ret = 0;
try {
ret = AuthenticationMethod.authenticate(context, un, pw, realm, request);
} catch (SQLException e) {
ret = PasswordAuthentication.NO_SUCH_USER;
}
if (ret == PasswordAuthentication.SUCCESS) {
EPerson me = context.getCurrentUser();
me.setLastActive(new Date());
try {
ePersonService.update(context, me);
} catch (SQLException ex) {
log.error("Could not update last-active stamp", ex);
} catch (AuthorizeException ex) {
log.error("Could not update last-active stamp", ex);
}
return ret;
}
if (ret < bestRet) {
bestRet = ret;
}
return bestRet;
And line 210:
@Override
public List<Group> getSpecialGroupsSword(Context context, HttpServletRequest request) throws SQLException{
PasswordAuthentication method = new PasswordAuthentication();
List<Group> result = new ArrayList<>();
int totalLen = 0;
List<Group> gl = method.getSpecialGroups(context, request);
if (gl.size() > 0)
{
result.addAll(gl);
totalLen += gl.size();
}
return result;
Then I had to reference them in the interface dspace-api/src/main/java/org/dspace/authenticate/service/AuthenticationService.java (line 188):
public int authenticateSword(Context context, String un, String pw, String realm, HttpServletRequest request);
public List<Group> getSpecialGroupsSword(Context context, HttpServletRequest request) throws SQLException;
And lastly for swordv2 I had to use them in dspace-swordv2/src/main/java/org/dspace/sword2/SwordAuthenticator.java
line 85-86
int auth = authenticationService
.authenticateSword(context, un, pw, null, null);
Line 196-197
List<Group> specialGroups = authenticationService
.getSpecialGroupsSword(context, null);
Line 228-229
List<Group> specialGroups = authenticationService
.getSpecialGroupsSword(oboContext, null);
Rebuild and redeploy. If you want it for swordV1 as well, you will need to also make the last set of changes to dspace-sword/src/main/java/org/dspace/sword/SWORDAuthenticator.java as well as the following import:
import org.dspace.authenticate.PasswordAuthentication;
Please note that I did this to allow XMLUI to use my ADFS authentication while allowing Sword and SwordV2 to use password authentication. You will need to fix accordingly
Hope this helps.
Shaun
--
All messages to this mailing list should adhere to the DuraSpace Code of Conduct: https://duraspace.org/about/policies/code-of-conduct/
---
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/CAK%3DKc-siPG1roGc8mAvWTQUCpA%2BVWmMvKypM%3DOuMx%3D%3DGAyA_gw%40mail.gmail.com.
Correct. Good Luck!
Shaun
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/CAK%3DKc-t_PopRb6gx%2B%2BtbGBYAa8KsWZZ3Qm8gr6OcjWbh5kFNCQ%40mail.gmail.com.