...
Code Block |
---|
@ApplicationScoped public class LoginBean { @Inject private LoginCredential loginCredential; @Inject private Identity identity; public boolean login(String userName, final String password) { this.loginCredential.setUserId(userName); this.loginCredential.setCredential(new Credential<String>() { @Override public String getValue() { return password; } }); this.identity.login(); return this.identity.isLoggedIn(); } public boolean logout() { this.identity.logout(); return !this.identity.isLoggedIn(); } } public class CustomBean { @Inject private Identity identity; @Inject private LoginBean loginBean; public void execute() { if(this.loginBean.login("spike", "apache")) { User user = this.identity.getUser(); //... } else { //... } } } |
Under discussion
API/SPI
...
Packages
- */authentication
- */authentication/events
- */authorization
- */authorization/annotation
- */credential or */authorization/credential
Part 1
Feature | Comments | Objections | Discussion finished |
---|---|---|---|
Login via Username/Password |
|
|
|
Password-Hash-Service |
|
|
|
Logout |
|
|
|
Authentication API and SPI | Credentials vs Credential (one of it needs a better name) |
|
|
Duration of a valid authentication | ExpirationEvaluator SPI |
|
|
Basic User/Identity API |
|
|
|
...