private void resolveWebProgrammaticLogin() { ServiceLocator habitat = SecurityServicesUtil.getInstance().getHabitat(); this.webProgrammaticLogin = habitat.getService(WebProgrammaticLogin.class); }
private void recordWebInvocation(final HttpServletRequest httpsr, final String type, final boolean isGranted) { AuditManager auditManager = SecurityServicesUtil.getInstance().getAuditManager(); if (auditManager != null && auditManager.isAuditOn() && (auditManager instanceof AppServerAuditManager)) { final AppServerAuditManager appServerAuditManager = (AppServerAuditManager) auditManager; Principal prin = httpsr.getUserPrincipal(); String user = (prin != null) ? prin.getName(): null; appServerAuditManager.webInvocation(user, httpsr, type, isGranted); } }
private boolean isAppclientContainer() { return SecurityServicesUtil.getInstance().isACC(); } }
CallbackHandler callbackHandler = SecurityServicesUtil.getInstance().getCallbackHandler(); if(loginName != null && password != null){
public java.lang.Object run() { //V3:Commentedif (isServer) { if (SecurityServicesUtil.getInstance() != null && SecurityServicesUtil.getInstance().isServer()) { LoginContextDriver.logout(); } else { // Reset the username/password state on logout UsernamePasswordStore.reset(); LoginContextDriver.doClientLogout(); //If user try to access a protected resource after here //then it will prompt for password in appclient or //just fail in standalone client. } return null; } });
private static synchronized AuditManager _getAuditManager() { if(AUDIT_MANAGER == null) { SecurityServicesUtil secServUtil = Globals.get(SecurityServicesUtil.class); AUDIT_MANAGER = secServUtil.getAuditManager(); } return AUDIT_MANAGER; }
public ProgrammaticLogin() { if (SecurityServicesUtil.getInstance() != null) { resolveWebProgrammaticLogin(); } }
secServUtil.setCallbackHandler(callbackHandler); util.setCallbackHandler(callbackHandler);
CallbackHandler callbackHandler = SecurityServicesUtil.getInstance().getCallbackHandler(); if(loginName != null && password != null){
public java.lang.Object run() { //V3:Commentedif (isServer) { if (SecurityServicesUtil.getInstance() != null && SecurityServicesUtil.getInstance().isServer()) { LoginContextDriver.logout(); } else { // Reset the username/password state on logout UsernamePasswordStore.reset(); LoginContextDriver.doClientLogout(); //If user try to access a protected resource after here //then it will prompt for password in appclient or //just fail in standalone client. } return null; } });
private static synchronized AuditManager _getAuditManager() { if(AUDIT_MANAGER == null) { SecurityServicesUtil secServUtil = Globals.get(SecurityServicesUtil.class); AUDIT_MANAGER = secServUtil.getAuditManager(); } return AUDIT_MANAGER; }
public ProgrammaticLogin() { if (SecurityServicesUtil.getInstance() != null) { resolveWebProgrammaticLogin(); } }
private void resolveWebProgrammaticLogin() { Habitat habitat = SecurityServicesUtil.getInstance().getHabitat(); this.webProgrammaticLogin = habitat.getComponent(WebProgrammaticLogin.class); }
public ContainerCallbackHandler() { if (Globals.getDefaultHabitat() == null || SecurityServicesUtil.getInstance().isACC()) { handler = new ClientContainerCallbackHandler(); } else { handler = new ServerContainerCallbackHandler(); } }
/** * Perform access control based on the <code>HttpServletRequest</code>. * Return <code>true</code> if this constraint is satisfied and processing * should continue, or <code>false</code> otherwise. * @return true is the resource is granted, false if denied */ public boolean hasResourcePermission(HttpServletRequest httpsr){ SecurityContext sc = getSecurityContext(httpsr.getUserPrincipal()); WebResourcePermission perm = createWebResourcePermission(httpsr); setSecurityInfo(httpsr); boolean isGranted = checkPermission(perm,sc.getPrincipalSet()); SecurityContext.setCurrent(sc); if(logger.isLoggable(Level.FINE)){ logger.log(Level.FINE, "[Web-Security] hasResource isGranted: {0}", isGranted); logger.log(Level.FINE, "[Web-Security] hasResource perm: {0}", perm); } AuditManager auditManager = SecurityServicesUtil.getInstance().getAuditManager(); if(auditManager !=null && auditManager.isAuditOn()){ Principal prin = httpsr.getUserPrincipal(); String user = (prin != null) ? prin.getName(): null; auditManager.webInvocation(user, httpsr, RESOURCE, isGranted); } return isGranted; }
s = LoginContextDriver.doClientLogin( SecurityConstants.USERNAME_PASSWORD, SecurityServicesUtil.getInstance().getCallbackHandler()); } else { s = sc.getSubject();
public java.lang.Boolean run() { // if realm is null, LCD will log into the default realm if (((SecurityServicesUtil.getInstance() != null) && SecurityServicesUtil.getInstance().isServer()) || Util.isEmbeddedServer()){ LoginContextDriver.login(user, password, realm); } else { int type = SecurityConstants.USERNAME_PASSWORD; //should not set realm here // Bugfix# 6387278. The UsernamePasswordStore // abstracts the thread-local/global details UsernamePasswordStore.set(user, password); try { LoginContextDriver.doClientLogin(type, handler); } finally { // For security, if thread-local no need to // save the username/password state UsernamePasswordStore.resetThreadLocalOnly(); } } return Boolean.valueOf(true); } });
@Override public void event(Event event) { if (EventTypes.SERVER_SHUTDOWN.equals(event.type())) { secServUtil.getAuditManager().serverShutdown(); } } }
public java.lang.Object run() throws Exception { /*V3:Commented assert(_serverContext != null); SecurityService securityService = _serverContext.getDefaultHabitat().getComponent(SecurityService.class); assert(securityService != null); return securityService.getDefaultPrincipal();*/ SecurityService securityService = SecurityServicesUtil.getInstance().getHabitat().getComponent(SecurityService.class); if(securityService==null) return null; return securityService.getDefaultPrincipal(); } });
public ContainerCallbackHandler() { if (Globals.getDefaultHabitat() == null || SecurityServicesUtil.getInstance().isACC()) { handler = new ClientContainerCallbackHandler(); } else { handler = new ServerContainerCallbackHandler(); } }