private Account verifyCredential(final AccountImpl account, final Object credential) { final AuthenticationManager authenticationManager = securityDomainContext.getAuthenticationManager(); final AuthorizationManager authorizationManager = securityDomainContext.getAuthorizationManager(); final SecurityContext sc = SecurityActions.getSecurityContext(); Principal incomingPrincipal = account.getOriginalPrincipal(); Subject subject = new Subject(); try { boolean isValid = authenticationManager.isValid(incomingPrincipal, credential, subject); if (isValid) { UndertowLogger.ROOT_LOGGER.tracef("User: %s is authenticated", incomingPrincipal); if (sc == null) { throw UndertowLogger.ROOT_LOGGER.noSecurityContext(); } Principal userPrincipal = getPrincipal(subject); sc.getUtil().createSubjectInfo(incomingPrincipal, credential, subject); SecurityContextCallbackHandler scb = new SecurityContextCallbackHandler(sc); RoleGroup roles = authorizationManager.getSubjectRoles(subject, scb); Set<String> roleSet = new HashSet<>(); for (Role role : roles.getRoles()) { roleSet.add(role.getRoleName()); } return new AccountImpl(userPrincipal, roleSet, credential, account.getOriginalPrincipal()); } } catch (Exception e) { throw new RuntimeException(e); } return null; }
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { for(Callback cb: callbacks) { if(cb instanceof SecurityContextCallback) { SecurityContextCallback scb = (SecurityContextCallback)cb; scb.setSecurityContext(securityContext); } else throw new UnsupportedCallbackException(cb); } } }
SecurityContextCallback scb = new SecurityContextCallback(); try SecurityContext sc = scb.getSecurityContext();
webResource.setCanonicalRequestURI(canonicalRequestURI); SecurityContextCallbackHandler sch = new SecurityContextCallbackHandler(this.securityContext); RoleGroup callerRoles = authzMgr.getSubjectRoles(callerSubject, sch);
SecurityContextCallback scb = new SecurityContextCallback(); try throw new RuntimeException(e); SecurityContext sc = scb.getSecurityContext();
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { for(Callback cb: callbacks) { if(cb instanceof SecurityContextCallback) { SecurityContextCallback scb = (SecurityContextCallback)cb; scb.setSecurityContext(securityContext); } else throw new UnsupportedCallbackException(cb); } } }
SecurityContextCallbackHandler sch = new SecurityContextCallbackHandler(this.securityContext); RoleGroup callerRoles = authzMgr.getSubjectRoles(callerSubject, sch);
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { for(Callback cb: callbacks) { if(cb instanceof SecurityContextCallback) { SecurityContextCallback scb = (SecurityContextCallback)cb; scb.setSecurityContext(securityContext); } else throw new UnsupportedCallbackException(cb); } } }
SecurityContextCallbackHandler sch = new SecurityContextCallbackHandler(this.securityContext); RoleGroup callerRoles = authzMgr.getSubjectRoles(callerSubject, sch);
SecurityContextCallbackHandler sch = new SecurityContextCallbackHandler(this.securityContext); RoleGroup callerRoles = am.getSubjectRoles(callerSubject, sch);
ejbResource.setEjbMethodRoles(methodRoles); SecurityContextCallbackHandler sch = new SecurityContextCallbackHandler(this.securityContext); RoleGroup callerRoles = am.getSubjectRoles(callerSubject, sch);
private Account verifyCredential(final AccountImpl account, final Object credential) { final AuthenticationManager authenticationManager = securityDomainContext.getAuthenticationManager(); final AuthorizationManager authorizationManager = securityDomainContext.getAuthorizationManager(); final SecurityContext sc = SecurityActions.getSecurityContext(); Principal incomingPrincipal = account.getOriginalPrincipal(); Subject subject = new Subject(); try { boolean isValid = authenticationManager.isValid(incomingPrincipal, credential, subject); if (isValid) { UndertowLogger.ROOT_LOGGER.tracef("User: %s is authenticated", incomingPrincipal); if (sc == null) { throw UndertowLogger.ROOT_LOGGER.noSecurityContext(); } Principal userPrincipal = getPrincipal(subject); sc.getUtil().createSubjectInfo(incomingPrincipal, credential, subject); SecurityContextCallbackHandler scb = new SecurityContextCallbackHandler(sc); RoleGroup roles = authorizationManager.getSubjectRoles(subject, scb); Set<String> roleSet = new HashSet<>(); for (Role role : roles.getRoles()) { roleSet.add(role.getRoleName()); } return new AccountImpl(userPrincipal, roleSet, credential, account.getOriginalPrincipal()); } } catch (Exception e) { throw new RuntimeException(e); } return null; }
private Account verifyCredential(final AccountImpl account, final Object credential) { final AuthenticationManager authenticationManager = securityDomainContext.getAuthenticationManager(); final AuthorizationManager authorizationManager = securityDomainContext.getAuthorizationManager(); final SecurityContext sc = SecurityActions.getSecurityContext(); Principal incomingPrincipal = account.getOriginalPrincipal(); Subject subject = new Subject(); try { boolean isValid = authenticationManager.isValid(incomingPrincipal, credential, subject); if (isValid) { UndertowLogger.ROOT_LOGGER.tracef("User: %s is authenticated", incomingPrincipal); if (sc == null) { throw UndertowLogger.ROOT_LOGGER.noSecurityContext(); } Principal userPrincipal = getPrincipal(subject); sc.getUtil().createSubjectInfo(incomingPrincipal, credential, subject); SecurityContextCallbackHandler scb = new SecurityContextCallbackHandler(sc); RoleGroup roles = authorizationManager.getSubjectRoles(subject, scb); Set<String> roleSet = new HashSet<>(); for (Role role : roles.getRoles()) { roleSet.add(role.getRoleName()); } return new AccountImpl(userPrincipal, roleSet, credential, account.getOriginalPrincipal()); } } catch (Exception e) { throw new RuntimeException(e); } return null; }
SecurityContextCallbackHandler sch = new SecurityContextCallbackHandler( this.securityContext ); RoleGroup callerRoles = am.getSubjectRoles( callerSubject, sch );
SecurityContextCallbackHandler sch = new SecurityContextCallbackHandler(this.securityContext); RoleGroup callerRoles = am.getSubjectRoles(callerSubject, sch);
SecurityContextCallbackHandler sch = new SecurityContextCallbackHandler(this.securityContext); RoleGroup callerRoles = null; if (roles == null)
SecurityContextCallbackHandler sch = new SecurityContextCallbackHandler(this.securityContext); RoleGroup callerRoles = null; if (roles == null)
ejbResource.add( ResourceKeys.ROLEREF_PERM_CHECK, Boolean.TRUE); SecurityContextCallbackHandler sch = new SecurityContextCallbackHandler(this.securityContext); RoleGroup callerRoles = am.getSubjectRoles( callerSubject, sch);
webResource.setCanonicalRequestURI(canonicalRequestURI); SecurityContextCallbackHandler sch = new SecurityContextCallbackHandler(this.securityContext); RoleGroup callerRoles = null; if (roles == null)
ejbResource.setEjbMethodRoles(methodRoles); SecurityContextCallbackHandler sch = new SecurityContextCallbackHandler(this.securityContext); RoleGroup callerRoles = am.getSubjectRoles(callerSubject, sch);