public boolean authenticate(Request request, HttpServletResponse response, LoginConfig config) throws IOException { return super.performAuthentication(request, (Response) response, config); } }
@Override protected boolean authenticate(Request request, Response response, LoginConfig loginConfig) throws IOException { return super.performAuthentication(request, response, loginConfig); }
@Override protected void doRegister(Request request, Response response, Principal principal, String password) { register(request, response, principal, this.authMethod, principal.getName(), password); } }
protected Principal getSubjectPrincipal() { if (subjectInteraction == null) { Class<?> clazz = loadClass(getClass(), subjectInteractionClassName); try { subjectInteraction = (SubjectSecurityInteraction) clazz.newInstance(); subjectInteraction.setSecurityDomain(context.getRealm().getContainer().getName()); } catch (Exception e) { throw new RuntimeException(e); } } Subject subject = subjectInteraction.get(); if (subject != null) { Set<Principal> principals = subject.getPrincipals(); if (!principals.isEmpty()) { return subject.getPrincipals().iterator().next(); } } return null; }
principal = getSubjectPrincipal(); if (principal == null) { throw new RuntimeException("Principal from subject is null"); session.setNote(Constants.SESS_PASSWORD_NOTE, password); request.setUserPrincipal(principal); doRegister(request, response, principal, password); if (originalPrincipal != null && needSubjectPrincipalSubstitution) { subjectInteraction.cleanup(originalPrincipal);
@Override public List<String> generateRoles(Principal principal) { if (principal instanceof SimplePrincipal) { //Use JACC to get the request try { HttpServletRequest request = (HttpServletRequest) PolicyContext.getContext("javax.servlet.http.HttpServletRequest"); if (request instanceof Request) { Request catalinaRequest = (Request) request; return super.generateRoles(catalinaRequest.getPrincipal()); } } catch (PolicyContextException e) { throw new RuntimeException(e); } } else { return super.generateRoles(principal); } return null; } }
protected Principal getSubjectPrincipal() { if (subjectInteraction == null) { Class<?> clazz = loadClass(getClass(), subjectInteractionClassName); try { subjectInteraction = (SubjectSecurityInteraction) clazz.newInstance(); subjectInteraction.setSecurityDomain(context.getRealm().getContainer().getName()); } catch (Exception e) { throw new RuntimeException(e); } } Subject subject = subjectInteraction.get(); if (subject != null) { Set<Principal> principals = subject.getPrincipals(); if (!principals.isEmpty()) { return subject.getPrincipals().iterator().next(); } } return null; }
public boolean authenticate(Request request, Response response, LoginConfig config) throws IOException { return super.performAuthentication(request, (Response) response, config); } }
@Override protected boolean authenticate(Request request, HttpServletResponse response, LoginConfig config) throws IOException { return super.performAuthentication(request, (Response) response, config); }
@Override protected void doRegister(Request request, Response response, Principal principal, String password) { register(request, response, principal, this.authMethod, principal.getName(), password); } }
@Override public List<String> generateRoles(Principal principal) { if (principal instanceof SimplePrincipal) { //Use JACC to get the request try { HttpServletRequest request = (HttpServletRequest) PolicyContext.getContext("javax.servlet.http.HttpServletRequest"); if (request instanceof Request) { Request catalinaRequest = (Request) request; return super.generateRoles(catalinaRequest.getPrincipal()); } } catch (PolicyContextException e) { throw new RuntimeException(e); } } else { return super.generateRoles(principal); } return null; } }
protected Principal getSubjectPrincipal() { if (subjectInteraction == null) { Class<?> clazz = loadClass(getClass(), subjectInteractionClassName); try { subjectInteraction = (SubjectSecurityInteraction) clazz.newInstance(); subjectInteraction.setSecurityDomain(context.getRealm().getContainer().getName()); } catch (Exception e) { throw new RuntimeException(e); } } Subject subject = subjectInteraction.get(); if (subject != null) { Set<Principal> principals = subject.getPrincipals(); if (!principals.isEmpty()) { return subject.getPrincipals().iterator().next(); } } return null; }