@Service @Singleton public class AuthenticationServiceImpl extends Object implements AuthenticationService, org.glassfish.hk2.api.PostConstruct
Constructor and Description |
---|
AuthenticationServiceImpl() |
Modifier and Type | Method and Description |
---|---|
Subject |
impersonate(String user,
String[] groups,
Subject subject,
boolean virtual)
Impersonate a user, specifying the user and group principal names that
should be established in the resulting Subject.
|
void |
initialize(SecurityConfiguration securityServiceConfiguration)
Initialize the Authentication Service configuration.
|
Subject |
login(CallbackHandler cbh,
Subject subject)
Authenticate using a CallbackHandler to provider username/password, X.509 certificate, or
Secure Admin token.
|
Subject |
login(String username,
char[] password,
Subject subject)
Log in a user with username and password.
|
void |
postConstruct()
Handle lookup of authentication service configuration and initialization.
|
public void initialize(SecurityConfiguration securityServiceConfiguration)
initialize
in interface SecurityService
public Subject login(String username, char[] password, Subject subject) throws LoginException
AuthenticationService
login
in interface AuthenticationService
username
- The username.password
- The password.subject
- An optional Subject to receive principals and credentials for the logged in user.
If provided, it will be returned as the return value; if not, a new Subject will be returned.LoginException
public Subject login(CallbackHandler cbh, Subject subject) throws LoginException
AuthenticationService
login
in interface AuthenticationService
cbh
- The CallbackHandler.subject
- An optional Subject to receive principals and credentials for the logged in user.
If provided, it will be returned as the return value; if not, a new Subject will be returned.LoginException
public Subject impersonate(String user, String[] groups, Subject subject, boolean virtual) throws LoginException
AuthenticationService
impersonate
in interface AuthenticationService
user
- The username.groups
- An array of group names. If subject
- An optional Subject to receive principals and credentials for the logged in user.
If provided, it will be returned as the return value; if not, a new Subject will be returned.virtual
- If true, simply create a subject with the given user and group names. If false, configured
UserStoreProvider will be queried for the given username and a Subject created only if the user exists. Groups
will be populated with the intersection of the groups parameter and the groups returned by the UserStoreProvider.LoginException
public void postConstruct()
postConstruct
in interface org.glassfish.hk2.api.PostConstruct
Copyright © 2018. All rights reserved.