2018-08-07 10:56:22 -07:00
|
|
|
package security;
|
|
|
|
|
|
2023-12-06 11:02:42 +05:30
|
|
|
import java.util.Map;
|
2018-08-07 10:56:22 -07:00
|
|
|
import javax.security.auth.Subject;
|
|
|
|
|
import javax.security.auth.callback.CallbackHandler;
|
|
|
|
|
import javax.security.auth.login.LoginException;
|
|
|
|
|
import javax.security.auth.spi.LoginModule;
|
2018-08-07 13:55:36 -07:00
|
|
|
|
2018-08-07 10:56:22 -07:00
|
|
|
/**
|
2023-12-06 11:02:42 +05:30
|
|
|
* This LoginModule performs dummy authentication. Any username and password can work for
|
|
|
|
|
* authentication
|
2018-08-07 10:56:22 -07:00
|
|
|
*/
|
|
|
|
|
public class DummyLoginModule implements LoginModule {
|
|
|
|
|
|
2023-12-06 11:02:42 +05:30
|
|
|
public void initialize(
|
|
|
|
|
final Subject subject,
|
|
|
|
|
final CallbackHandler callbackHandler,
|
|
|
|
|
final Map<String, ?> sharedState,
|
|
|
|
|
final Map<String, ?> options) {}
|
2018-08-07 10:56:22 -07:00
|
|
|
|
|
|
|
|
public boolean login() throws LoginException {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean commit() throws LoginException {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean abort() throws LoginException {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean logout() throws LoginException {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2023-12-06 11:02:42 +05:30
|
|
|
}
|