Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. @RequestScoped
  2. @Named
  3. public class AuthenticatorSelector {
  4.  
  5. @Inject Instance<CustomAuthenticator> customAuthenticator;
  6. @Inject Instance<IdmAuthenticator> idmAuthenticator;
  7.  
  8. private String authenticator;
  9.  
  10. public String getAuthenticator() {
  11.  
  12. return authenticator;
  13. }
  14.  
  15. public void setAuthenticator(String authenticator) {
  16. this.authenticator = authenticator;
  17. }
  18.  
  19. @Produces
  20. @PicketLink
  21. public Authenticator selectAuthenticator() {
  22. if ("custom".equals(authenticator)) {
  23. return customAuthenticator.get();
  24. } else {
  25. return idmAuthenticator.get();
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement