docs/docs-core/src/main/java/com/sismics/docs/core/util/authentication/InternalAuthenticationHandler.java

20 lines
591 B
Java
Raw Normal View History

2018-03-26 22:07:26 +02:00
package com.sismics.docs.core.util.authentication;
2018-03-29 17:59:47 +02:00
import com.sismics.docs.core.dao.UserDao;
2018-03-26 22:07:26 +02:00
import com.sismics.docs.core.model.jpa.User;
import com.sismics.util.ClasspathScanner;
/**
* Authenticate using the internal database.
*
* @author bgamard
*/
@ClasspathScanner.Priority(100) // We can add handlers before this one
public class InternalAuthenticationHandler implements AuthenticationHandler {
@Override
public User authenticate(String username, String password) {
UserDao userDao = new UserDao();
return userDao.authenticate(username, password);
}
}