final HttpSession session = webRequest.getSession(); requestContext.setSecurityContext(new SecurityContext() { @Override public Principal getUserPrincipal() {
@Override protected void cleanArtifacts(DeploymentContext dc) throws DeploymentException { removePolicy(dc); SecurityUtil.removeRoleMapper(dc); }
private static synchronized PermissionCache createSecurityManagerCache() { Integer key = getNextKey(); PermissionCache cache = new PermissionCache(key, null, null, protoPerms, null); return registerPermissionCache(cache); }
/** * This method sets the security context on the current Thread Local * Storage * @param String username is the user who authenticated * @param Subject is the subject representation of the user * @param Credentials the credentials that the server associated with it */ private static void setSecurityContext(String userName, Subject subject, String realm) { SecurityContext securityContext = new SecurityContext(userName, subject, realm); SecurityContext.setCurrent(securityContext); }
/** * Set the current security context on the Thread Local Storage to null. * */ private static void unsetSecurityContext() { SecurityContext.setCurrent((SecurityContext)null); } /**
/** * This method returns the caller principal. * This information may be redundant since the same information * can be inferred by inspecting the Credentials of the caller. * @return The caller Principal. */ public Principal getCallerPrincipal() { return this == defaultSecurityContext ? getDefaultCallerPrincipal() : initiator; }
/** Closes the dialog */ private void closeDialog(java.awt.event.WindowEvent evt) { setVisible (false); dispose (); }
/** * Returns the username, that was previously stored. * * @return The username set previously or null if not set */ public static String getUsername() { UsernamePasswordStore ups = UsernamePasswordStore.get(); if( ups != null ) return ups.username; else return null; }
private boolean checkConnectPermission() { if (cacheEnabled()) { return connectPerm.checkPermission(); } return false; }
public void windowClosing (WindowEvent we){ dispose (); } });
/** * This method sets the security context on the current Thread Local * Storage * @param String username is the user who authenticated * @param Subject is the subject representation of the user * @param Credentials the credentials that the server associated with it */ private static void setSecurityContext(String userName, Subject subject, String realm) { SecurityContext securityContext = new SecurityContext(userName, subject, realm); SecurityContext.setCurrent(securityContext); }
/** * No need to unmarshall the unauthenticated principal.... */ public static void reset(SecurityContext sc){ setCurrent(sc); }
private void initDefaultCallerPrincipal() { if (this.initiator == null) { this.initiator = getDefaultCallerPrincipal(); } }
@Override public SecurityContext run() { return new SecurityContext(s); } });
/** Closes the dialog */ private void closeDialog(java.awt.event.WindowEvent evt) { setVisible (false); dispose (); }
/** * Returns the username, that was previously stored. * * @return The username set previously or null if not set */ public static String getUsername() { UsernamePasswordStore ups = UsernamePasswordStore.get(); if( ups != null ) return ups.username; else return null; }
/** * No need to unmarshall the unauthenticated principal.... */ public static void reset(SecurityContext sc){ setCurrent(sc); }
/** * This method returns the caller principal. * This information may be redundant since the same information * can be inferred by inspecting the Credentials of the caller. * @return The caller Principal. */ public Principal getCallerPrincipal() { return this == defaultSecurityContext ? getDefaultCallerPrincipal() : initiator; }
/** * This is called on the server to unset the security context * this is introduced to prevent the re-use of the thread * security context on re-use of the thread. */ public static void unsetSecurityContext(boolean isLocal) { // logout method from LoginContext not called // as we dont want to unset the appcontainer context if (!isLocal) { com.sun.enterprise.security.SecurityContext.setCurrent(null); } }
private void initDefaultCallerPrincipal() { if (this.initiator == null) { this.initiator = getDefaultCallerPrincipal(); } }