mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-16 22:43:12 +00:00
[DS-436] SWORD Authenticator doesn't support the special groups infrastructure
git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@4637 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -195,6 +195,10 @@ public class IPAuthentication implements AuthenticationMethod
|
|||||||
public int[] getSpecialGroups(Context context, HttpServletRequest request)
|
public int[] getSpecialGroups(Context context, HttpServletRequest request)
|
||||||
throws SQLException
|
throws SQLException
|
||||||
{
|
{
|
||||||
|
if (request == null)
|
||||||
|
{
|
||||||
|
return new int[0];
|
||||||
|
}
|
||||||
List<Integer> groupIDs = new ArrayList<Integer>();
|
List<Integer> groupIDs = new ArrayList<Integer>();
|
||||||
|
|
||||||
String addr = request.getRemoteAddr();
|
String addr = request.getRemoteAddr();
|
||||||
|
@@ -71,6 +71,10 @@ public class ShibAuthentication implements AuthenticationMethod
|
|||||||
public int authenticate(Context context, String username, String password,
|
public int authenticate(Context context, String username, String password,
|
||||||
String realm, HttpServletRequest request) throws SQLException
|
String realm, HttpServletRequest request) throws SQLException
|
||||||
{
|
{
|
||||||
|
if (request == null)
|
||||||
|
{
|
||||||
|
return BAD_ARGS;
|
||||||
|
}
|
||||||
log.info("Shibboleth login started...");
|
log.info("Shibboleth login started...");
|
||||||
|
|
||||||
java.util.Enumeration names = request.getHeaderNames();
|
java.util.Enumeration names = request.getHeaderNames();
|
||||||
@@ -218,7 +222,7 @@ public class ShibAuthentication implements AuthenticationMethod
|
|||||||
public int[] getSpecialGroups(Context context, HttpServletRequest request)
|
public int[] getSpecialGroups(Context context, HttpServletRequest request)
|
||||||
{
|
{
|
||||||
// no user logged in or user not logged from shibboleth
|
// no user logged in or user not logged from shibboleth
|
||||||
if (context.getCurrentUser() == null
|
if (request == null || context.getCurrentUser() == null
|
||||||
|| request.getSession().getAttribute("shib.authenticated") == null)
|
|| request.getSession().getAttribute("shib.authenticated") == null)
|
||||||
{
|
{
|
||||||
return new int[0];
|
return new int[0];
|
||||||
|
@@ -496,6 +496,10 @@ public class X509Authentication implements AuthenticationMethod
|
|||||||
public int[] getSpecialGroups(Context context, HttpServletRequest request)
|
public int[] getSpecialGroups(Context context, HttpServletRequest request)
|
||||||
throws SQLException
|
throws SQLException
|
||||||
{
|
{
|
||||||
|
if (request == null)
|
||||||
|
{
|
||||||
|
return new int[0];
|
||||||
|
}
|
||||||
|
|
||||||
Boolean authenticated = false;
|
Boolean authenticated = false;
|
||||||
HttpSession session = request.getSession(false);
|
HttpSession session = request.getSession(false);
|
||||||
|
@@ -262,6 +262,15 @@ public class SWORDAuthenticator
|
|||||||
{
|
{
|
||||||
authenticated = true;
|
authenticated = true;
|
||||||
sc.setAuthenticated(ep);
|
sc.setAuthenticated(ep);
|
||||||
|
// Set any special groups - invoke the authentication mgr.
|
||||||
|
int[] groupIDs = AuthenticationManager.getSpecialGroups(context, null);
|
||||||
|
|
||||||
|
for (int i = 0; i < groupIDs.length; i++)
|
||||||
|
{
|
||||||
|
context.setSpecialGroup(groupIDs[i]);
|
||||||
|
log.debug("Adding Special Group id="+String.valueOf(groupIDs[i]));
|
||||||
|
}
|
||||||
|
|
||||||
sc.setAuthenticatorContext(context);
|
sc.setAuthenticatorContext(context);
|
||||||
sc.setContext(context);
|
sc.setContext(context);
|
||||||
}
|
}
|
||||||
@@ -283,6 +292,14 @@ public class SWORDAuthenticator
|
|||||||
sc.setOnBehalfOf(epObo);
|
sc.setOnBehalfOf(epObo);
|
||||||
Context oboContext = this.constructContext(ip);
|
Context oboContext = this.constructContext(ip);
|
||||||
oboContext.setCurrentUser(epObo);
|
oboContext.setCurrentUser(epObo);
|
||||||
|
// Set any special groups - invoke the authentication mgr.
|
||||||
|
int[] groupIDs = AuthenticationManager.getSpecialGroups(oboContext, null);
|
||||||
|
|
||||||
|
for (int i = 0; i < groupIDs.length; i++)
|
||||||
|
{
|
||||||
|
oboContext.setSpecialGroup(groupIDs[i]);
|
||||||
|
log.debug("Adding Special Group id="+String.valueOf(groupIDs[i]));
|
||||||
|
}
|
||||||
sc.setContext(oboContext);
|
sc.setContext(oboContext);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -113,6 +113,7 @@
|
|||||||
- [DS-260] Template item some times has owningCollection filled and some times not
|
- [DS-260] Template item some times has owningCollection filled and some times not
|
||||||
- [DS-309] Shiboleth default roles are applied also to anonymous user and user logged-in with other methods
|
- [DS-309] Shiboleth default roles are applied also to anonymous user and user logged-in with other methods
|
||||||
- [DS-270] Make delegate admin permissions configurable
|
- [DS-270] Make delegate admin permissions configurable
|
||||||
|
- [DS-436] SWORD Authenticator doesn't support the special groups infrastructure
|
||||||
|
|
||||||
(Tim Donohue)
|
(Tim Donohue)
|
||||||
- [DS-218] Cannot add/remove email subscriptions from Profile page in XMLUI
|
- [DS-218] Cannot add/remove email subscriptions from Profile page in XMLUI
|
||||||
|
Reference in New Issue
Block a user