Skip to content

Commit 30b8999

Browse files
authored
Merge pull request DSpace#11406 from tdonohue/remove_x509
Remove X.509 certificate authentication from DSpace
2 parents 80758a7 + f0c365c commit 30b8999

File tree

12 files changed

+21
-671
lines changed

12 files changed

+21
-671
lines changed

dspace-api/src/main/java/org/dspace/authenticate/AuthenticationMethod.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public interface AuthenticationMethod {
5454
public static final int BAD_CREDENTIALS = 2;
5555

5656
/**
57-
* Not allowed to login this way without X.509 certificate.
57+
* Not allowed to login this way without a certificate.
5858
*/
5959
public static final int CERT_REQUIRED = 3;
6060

@@ -124,8 +124,8 @@ public boolean allowSetPassword(Context context,
124124
* Predicate, is this an implicit authentication method.
125125
* An implicit method gets credentials from the environment (such as
126126
* an HTTP request or even Java system properties) rather than the
127-
* explicit username and password. For example, a method that reads
128-
* the X.509 certificates in an HTTPS request is implicit.
127+
* explicit username and password. For example, a method that provides
128+
* IP-based authentication is implicit.
129129
*
130130
* @return true if this method uses implicit authentication.
131131
*/
@@ -188,7 +188,7 @@ public default boolean areSpecialGroupsApplicable(Context context, HttpServletRe
188188
* <p>Meaning:
189189
* <br>SUCCESS - authenticated OK.
190190
* <br>BAD_CREDENTIALS - user exists, but credentials (e.g. passwd) don't match
191-
* <br>CERT_REQUIRED - not allowed to login this way without X.509 cert.
191+
* <br>CERT_REQUIRED - not allowed to login this way without a cert.
192192
* <br>NO_SUCH_USER - user not found using this method.
193193
* <br>BAD_ARGS - user/pw not appropriate for this method
194194
* @throws SQLException if database error

dspace-api/src/main/java/org/dspace/authenticate/AuthenticationServiceImpl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@
3838
* <b>Configuration</b><br>
3939
* The stack of authentication methods is defined by one property in the DSpace configuration:
4040
* <pre>
41-
* plugin.sequence.org.dspace.eperson.AuthenticationMethod = <em>a list of method class names</em>
41+
* plugin.sequence.org.dspace.authenticate.AuthenticationMethod = <em>a list of method class names</em>
4242
* <em>e.g.</em>
43-
* plugin.sequence.org.dspace.eperson.AuthenticationMethod = \
44-
* org.dspace.eperson.X509Authentication, \
45-
* org.dspace.eperson.PasswordAuthentication
43+
* plugin.sequence.org.dspace.authenticate.AuthenticationMethod = \
44+
* org.dspace.authenticate.IPAuthentication, \
45+
* org.dspace.authenticate.PasswordAuthentication
4646
* </pre>
4747
* <p>
4848
* The "stack" is always traversed in order, with the methods

dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public List<Group> getSpecialGroups(Context context, HttpServletRequest request)
204204
* <p>Meaning:
205205
* <br>SUCCESS - authenticated OK.
206206
* <br>BAD_CREDENTIALS - user exists, but credentials (e.g. passwd) don't match
207-
* <br>CERT_REQUIRED - not allowed to login this way without X.509 cert.
207+
* <br>CERT_REQUIRED - not allowed to login this way without a cert.
208208
* <br>NO_SUCH_USER - user not found using this method.
209209
* <br>BAD_ARGS - user/pw not appropriate for this method
210210
*/

dspace-api/src/main/java/org/dspace/authenticate/PasswordAuthentication.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public List<Group> getSpecialGroups(Context context, HttpServletRequest request)
188188
* <p>Meaning:
189189
* <br>SUCCESS - authenticated OK.
190190
* <br>BAD_CREDENTIALS - user exists, but password doesn't match
191-
* <br>CERT_REQUIRED - not allowed to login this way without X.509 cert.
191+
* <br>CERT_REQUIRED - not allowed to login this way without a cert.
192192
* <br>NO_SUCH_USER - no EPerson with matching email address.
193193
* <br>BAD_ARGS - missing username, or user matched but cannot login.
194194
* @throws SQLException if database error
@@ -213,7 +213,7 @@ public int authenticate(Context context,
213213
// cannot login this way
214214
return BAD_ARGS;
215215
} else if (eperson.getRequireCertificate()) {
216-
// this user can only login with x.509 certificate
216+
// this user can only login with a certificate
217217
log.warn(LogHelper.getHeader(context, "authenticate",
218218
"rejecting PasswordAuthentication because " + username + " requires " +
219219
"certificate."));

dspace-api/src/main/java/org/dspace/authenticate/ShibAuthentication.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public class ShibAuthentication implements AuthenticationMethod {
160160
* SUCCESS - authenticated OK. <br>
161161
* BAD_CREDENTIALS - user exists, but credentials (e.g. passwd)
162162
* don't match <br>
163-
* CERT_REQUIRED - not allowed to login this way without X.509 cert.
163+
* CERT_REQUIRED - not allowed to login this way without a cert.
164164
* <br>
165165
* NO_SUCH_USER - user not found using this method. <br>
166166
* BAD_ARGS - user/pw not appropriate for this method
@@ -417,8 +417,7 @@ public boolean allowSetPassword(Context context,
417417
* Predicate, is this an implicit authentication method. An implicit method
418418
* gets credentials from the environment (such as an HTTP request or even
419419
* Java system properties) rather than the explicit username and password.
420-
* For example, a method that reads the X.509 certificates in an HTTPS
421-
* request is implicit.
420+
* For example, a method that provides IP-based authentication is implicit.
422421
*
423422
* @return true if this method uses implicit authentication.
424423
*/
@@ -917,7 +916,7 @@ protected int swordCompatibility(Context context, String username, String passwo
917916
" is not allowed to login.");
918917
return BAD_ARGS;
919918
} else if (eperson.getRequireCertificate()) {
920-
// this user can only login with x.509 certificate
919+
// this user can only login with a certificate
921920
log.error(
922921
"Shibboleth-based password authentication failed for user " + username + " because the eperson object" +
923922
" requires a certificate to authenticate..");

0 commit comments

Comments
 (0)