use of org.glassfish.security.services.api.authentication.AuthenticationService in project Payara by payara.
the class AuthenticationServiceFactory method provide.
@SecurityScope
public AuthenticationService provide() {
String currentState = manager.getCurrent();
// Get Service Instance
AuthenticationService atnService = AccessController.doPrivileged(new PrivilegedLookup<AuthenticationService>(serviceLocator, AuthenticationService.class));
// Get Service Configuration
org.glassfish.security.services.config.AuthenticationService atnConfiguration = serviceLocator.getService(org.glassfish.security.services.config.AuthenticationService.class, currentState);
// Initialize Service
atnService.initialize(atnConfiguration);
return atnService;
}
use of org.glassfish.security.services.api.authentication.AuthenticationService in project Payara by payara.
the class GlassFishSecurityProvider method authenticate.
@Override
public Object authenticate(String username, String password) {
gf = getGlassFish();
AuthenticationService authService = null;
try {
authService = getAuthService();
} catch (GlassFishException gfe) {
gfe.printStackTrace();
return null;
}
Subject fs = null;
try {
fs = authService.login(username, password.toCharArray(), fs);
} catch (LoginException e) {
e.printStackTrace();
return null;
}
return fs;
}
Aggregations