diff --git a/src/main/java/edu/harvard/iq/dataverse/Shib.java b/src/main/java/edu/harvard/iq/dataverse/Shib.java index bb87cf6d5dd..8baa24067d7 100644 --- a/src/main/java/edu/harvard/iq/dataverse/Shib.java +++ b/src/main/java/edu/harvard/iq/dataverse/Shib.java @@ -320,6 +320,7 @@ public String confirmAndConvertAccount() { logger.fine("builtin username: " + builtinUsername); AuthenticatedUser builtInUserToConvert = authSvc.canLogInAsBuiltinUser(builtinUsername, builtinPassword); if (builtInUserToConvert != null) { + // TODO: Switch from authSvc.convertBuiltInToShib to authSvc.convertBuiltInUserToRemoteUser AuthenticatedUser au = authSvc.convertBuiltInToShib(builtInUserToConvert, shibAuthProvider.getId(), userIdentifier); if (au != null) { authSvc.updateAuthenticatedUser(au, displayInfo); diff --git a/src/main/java/edu/harvard/iq/dataverse/authorization/AuthenticationServiceBean.java b/src/main/java/edu/harvard/iq/dataverse/authorization/AuthenticationServiceBean.java index 51cc7f4b85e..0395c2453db 100644 --- a/src/main/java/edu/harvard/iq/dataverse/authorization/AuthenticationServiceBean.java +++ b/src/main/java/edu/harvard/iq/dataverse/authorization/AuthenticationServiceBean.java @@ -781,11 +781,12 @@ public AuthenticatedUser canLogInAsBuiltinUser(String username, String password) AuthenticationRequest authReq = new AuthenticationRequest(); /** - * @todo Should this really be coming from a bundle like this? Added - * because that's what BuiltinAuthenticationProvider does. + * @todo Should the credential key really be a Bundle key? + * BuiltinAuthenticationProvider.KEY_USERNAME_OR_EMAIL, for example, is + * "login.builtin.credential.usernameOrEmail" as of this writing. */ - authReq.putCredential(BundleUtil.getStringFromBundle("login.builtin.credential.usernameOrEmail"), username); - authReq.putCredential(BundleUtil.getStringFromBundle("login.builtin.credential.password"), password); + authReq.putCredential(BuiltinAuthenticationProvider.KEY_USERNAME_OR_EMAIL, username); + authReq.putCredential(BuiltinAuthenticationProvider.KEY_PASSWORD, password); /** * @todo Should probably set IP address here. */ diff --git a/src/main/java/edu/harvard/iq/dataverse/authorization/providers/builtin/BuiltinAuthenticationProvider.java b/src/main/java/edu/harvard/iq/dataverse/authorization/providers/builtin/BuiltinAuthenticationProvider.java index ed7607c91cf..c9edd04cc1e 100644 --- a/src/main/java/edu/harvard/iq/dataverse/authorization/providers/builtin/BuiltinAuthenticationProvider.java +++ b/src/main/java/edu/harvard/iq/dataverse/authorization/providers/builtin/BuiltinAuthenticationProvider.java @@ -23,8 +23,14 @@ public class BuiltinAuthenticationProvider implements CredentialsAuthenticationProvider { public static final String PROVIDER_ID = "builtin"; - private static final String KEY_USERNAME_OR_EMAIL = "login.builtin.credential.usernameOrEmail"; - private static final String KEY_PASSWORD = "login.builtin.credential.password"; + /** + * TODO: Think more about if it really makes sense to have the key for a + * credential be a Bundle key. What if we want to reorganize our Bundle + * files and rename some Bundle keys? Would login be broken until we update + * the strings below? + */ + public static final String KEY_USERNAME_OR_EMAIL = "login.builtin.credential.usernameOrEmail"; + public static final String KEY_PASSWORD = "login.builtin.credential.password"; private static List CREDENTIALS_LIST; final BuiltinUserServiceBean bean;