Returns the security context from the execution context.

@return The security context, or null if one cannot be determined.
978076
public static SecurityContext getSecurityContext() {
        Session session = ExecutionContext.getSession();
        @SuppressWarnings("resource")
        WebSocketSession ws = session == null ? null : session.getSocket();
        return ws == null ? null
                : (SecurityContext) ws.getAttributes().get(HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY);
    }
1150058
protected ELContext getELContext() {
	FacesContext fc = getFacesContext();
	ELContext result = null;
	if (null != fc) {
	    result = fc.getELContext();
	}
	return result;
    }
1251136
private LoginContext getClientLoginContext() throws LoginException {
        Configuration config = new Configuration() {
            @Override
            public AppConfigurationEntry[] getAppConfigurationEntry(String name) {
                Map<String, String> options = new HashMap<String, String>();
                options.put("multi-threaded", "true");
                options.put("restore-login-identity", "true");

                AppConfigurationEntry clmEntry = new AppConfigurationEntry(ClientLoginModule.class.getName(), LoginModuleControlFlag.REQUIRED, options);
                return new AppConfigurationEntry[] { clmEntry };
            }
        };
        return getLoginContext(config);
    }
597488
@Deprecated
    public static AccessAuditContext currentAccessAuditContext() {
        if (WildFlySecurityManager.isChecking()) {
            System.getSecurityManager().checkPermission(ControllerPermission.GET_CURRENT_ACCESS_AUDIT_CONTEXT);
        }
        return contextThreadLocal.get();
    }
591524
public static ControlContainerContext getContext() 
    {
        Stack<ControlContainerContext> contextStack = _threadContexts.get();
        if (contextStack == null || contextStack.size() == 0)
            return null;

        return contextStack.peek();
    }
92593
public static String getFlowContext() {
    TransactionLogger instance = getInstance();
    if (instance == null) {
      return null;
    }

    return instance.flowContext;
  }
1295145
@Override
    public String getContextPath() {
        if (SecurityUtil.isPackageProtectionEnabled()) {
            return (String) doPrivileged("getContextPath", null);
        } else {
            return context.getContextPath();
        }
    }
324156
protected WebAppDispatcherContext getDispatchContext() {
        WebAppDispatcherContext dc=(WebAppDispatcherContext)SRTServletRequestThreadData.getInstance().getDispatchContext();
        if (dc==null)
            dc = _dispatchContext;
        
        return dc;
    }
53303
@Nullable
    public final Context getApplicationContext() {
        Activity activity = getActivity();
        return activity != null ? activity.getApplicationContext() : null;
    }
1189025
private static ContextRuntime getRootContext(final Injector injector,
                                               final Configuration rootContextConfiguration,
                                               final Optional<Configuration> rootServiceConfiguration)
      throws ContextClientCodeException {
    final ContextRuntime result;
    if (rootServiceConfiguration.isPresent()) {
      final Injector rootServiceInjector;
      try {
        rootServiceInjector = injector.forkInjector(rootServiceConfiguration.get());
      } catch (final BindException e) {
        throw new ContextClientCodeException(ContextClientCodeException.getIdentifier(rootContextConfiguration),
            Optional.<String>empty(), "Unable to instatiate the root context", e);
      }
      result = new ContextRuntime(rootServiceInjector, rootContextConfiguration);
    } else {
      result = new ContextRuntime(injector.forkInjector(), rootContextConfiguration);
    }
    return result;
  }
1315380
private Set<ISharedObjectSecurity> getSecurityHandlers() {
        ISharedObjectSecurityService security = (ISharedObjectSecurityService) ScopeUtils.getScopeService(getParent(), ISharedObjectSecurityService.class);
        if (security == null) {
            return null;
        }
        return security.getSharedObjectSecurity();
    }
353697
def getContext(self):
        """"""
        ctx = ClientContextFactory.getContext(self)
        ctx.set_options(OP_NO_SSLv3)
        return ctx
521209
private SecurityContext checkAuthentication(final CallContext callContext) {

		final App app = StructrApp.getInstance();

		try (final Tx tx = app.tx()) {

			final String username           = callContext.getUsername();
			final String password           = callContext.getPassword();
			final Principal principal       = AuthHelper.getPrincipalForPassword(Principal.name, username, password);
			SecurityContext securityContext = null;

			if (principal != null) {


				if (principal instanceof SuperUser) {

					securityContext = SecurityContext.getSuperUserInstance();

				} else {

					securityContext = SecurityContext.getInstance(principal, AccessMode.Backend);
				}
			}

			tx.success();

			if (securityContext != null) {
				return securityContext;
			}

		} catch (AuthenticationException aex) {

			throw new CmisUnauthorizedException(aex.getMessage());

		} catch (FrameworkException fex) {

			logger.warn("", fex);
		}

		throw new CmisUnauthorizedException();
	}
62785
protected LoginContext getLoginContext(final UsernamePasswordCredential credential) throws GeneralSecurityException {
        val callbackHandler = new UsernamePasswordCallbackHandler(credential.getUsername(), credential.getPassword());
        if (this.loginConfigurationFile != null && StringUtils.isNotBlank(this.loginConfigType)
            && this.loginConfigurationFile.exists() && this.loginConfigurationFile.canRead()) {
            final Configuration.Parameters parameters = new URIParameter(loginConfigurationFile.toURI());
            val loginConfig = Configuration.getInstance(this.loginConfigType, parameters);
            return new LoginContext(this.realm, null, callbackHandler, loginConfig);
        }
        return new LoginContext(this.realm, callbackHandler);
    }
1157884
public Context getContext() {
		if (context == null) {
			context = Model.getSingleton().getSession().getContext(this.contextId);
		}
		return context;
	}
1373000
public java.util.List<SecurityGroupReference> getSecurityGroupReferenceSet() {
        if (securityGroupReferenceSet == null) {
            securityGroupReferenceSet = new com.amazonaws.internal.SdkInternalList<SecurityGroupReference>();
        }
        return securityGroupReferenceSet;
    }
1287930
public function getSecurityContexts()
    {
        $contexts = [];
        $this->iterateAdmins(function(Admin $admin) use (&$contexts) {
            $contexts = array_merge_recursive($contexts, $admin->getSecurityContexts());
        });

        return $contexts;
    }