Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @RequestScoped
- @Named
- public class AuthenticatorSelector {
- @Inject Instance<CustomAuthenticator> customAuthenticator;
- @Inject Instance<IdmAuthenticator> idmAuthenticator;
- private String authenticator;
- public String getAuthenticator() {
- return authenticator;
- }
- public void setAuthenticator(String authenticator) {
- this.authenticator = authenticator;
- }
- @Produces
- @PicketLink
- public Authenticator selectAuthenticator() {
- if ("custom".equals(authenticator)) {
- return customAuthenticator.get();
- } else {
- return idmAuthenticator.get();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement