Examples of SecurityContextImpl


Examples of org.apache.wink.server.internal.contexts.SecurityContextImpl

            .getProvidersRegistry(), this));
        setAttribute(HttpHeaders.class, new HttpHeadersImpl(this));
        UriInfoImpl uriInfoImpl = new UriInfoImpl(this);
        setAttribute(UriInfo.class, uriInfoImpl);
        setAttribute(UriInfoImpl.class, uriInfoImpl);
        setAttribute(SecurityContext.class, new SecurityContextImpl(this));
        setAttribute(Request.class, new RequestImpl(this));
        setAttribute(LinkBuilders.class, new LinkBuildersImpl(this));
    }
View Full Code Here

Examples of org.geomajas.internal.security.SecurityContextImpl

  public void testLogout() throws Exception {
    Authentication auth = new Authentication();
    auth.setAuthorizations(new BaseAuthorization[0]);
    auth.setSecurityServiceId(StaticSecurityService.SECURITY_SERVICE_ID); // mimic that this comes from the StaticSecurity stuff
    String token = tokenService.login(auth);
    SecurityContextImpl securityContext = (SecurityContextImpl) this.securityContext;
    List<Authentication> auths = new ArrayList<Authentication>();
    auths.add(auth);
    securityContext.setAuthentications(token, auths);

    Assert.assertEquals(token, securityContext.getToken());
    EmptyCommandRequest request = new EmptyCommandRequest();
    SuccessCommandResponse response = logoutCommand.getEmptyCommandResponse();
    logoutCommand.execute(request, response);
    Assert.assertTrue(response.isSuccess());
    Assert.assertNull(tokenService.getAuthentication(token));
View Full Code Here

Examples of org.italiangrid.utils.voms.SecurityContextImpl

     */
    protected synchronized void getFQANsFromSecurityContext() {

        log.debug( "Fectching FQANs out of the security context");
       
        SecurityContextImpl ctxt = SecurityContextImpl.getCurrentContext();
       
        try {

            List <VOMSAttribute> attrs = validator.validate(ctxt.getClientCertChain());

            List <VOMSFQAN> myFQANs = new ArrayList <VOMSFQAN>();

            for ( VOMSAttribute voAttr : attrs ) {

View Full Code Here

Examples of org.jboss.arquillian.extension.rest.warp.spi.SecurityContextImpl

     *
     * @return the {@link SecurityContext}
     */
    private SecurityContext buildSecurityContext() {

        SecurityContextImpl securityContext = new SecurityContextImpl();

        if(containerRequest != null) {
            securityContext.setPrincipal(containerRequest.getUserPrincipal());
            securityContext.setAuthenticationScheme(containerRequest.getAuthenticationScheme());
        }
        return securityContext;
    }
View Full Code Here

Examples of org.jboss.arquillian.extension.rest.warp.spi.SecurityContextImpl

     *
     * @return the {@link SecurityContext}
     */
    private SecurityContext buildSecurityContext() {

        SecurityContextImpl securityContext = new SecurityContextImpl();

        if (containerRequestContext != null && containerRequestContext.getSecurityContext() != null) {
            securityContext.setAuthenticationScheme(containerRequestContext.getSecurityContext().getAuthenticationScheme());
            securityContext.setPrincipal(containerRequestContext.getSecurityContext().getUserPrincipal());
        }

        return securityContext;
    }
View Full Code Here

Examples of org.jboss.arquillian.extension.rest.warp.spi.SecurityContextImpl

     *
     * @return the {@link SecurityContext}
     */
    private SecurityContext buildSecurityContext() {

        SecurityContextImpl securityContext = new SecurityContextImpl();
        if (this.securityContext != null) {
            securityContext.setPrincipal(this.securityContext.getUserPrincipal());
            securityContext.setAuthenticationScheme(this.securityContext.getAuthenticationScheme());
        }
        return securityContext;
    }
View Full Code Here

Examples of org.jboss.arquillian.extension.rest.warp.spi.SecurityContextImpl

     *
     * @return the {@link SecurityContext}
     */
    private SecurityContext buildSecurityContext() {

        SecurityContextImpl securityContext = new SecurityContextImpl();

        if(messageContext != null && messageContext.getSecurityContext() != null) {
            securityContext.setPrincipal(messageContext.getSecurityContext().getUserPrincipal());
            securityContext.setAuthenticationScheme(messageContext.getSecurityContext().getAuthenticationScheme());
        }
        return securityContext;
    }
View Full Code Here

Examples of org.springframework.security.context.SecurityContextImpl

                username,
                new GrantedAuthority[] {
                        new GrantedAuthorityImpl("ROLE_TELLER"),
                        new GrantedAuthorityImpl("ROLE_PERMISSION_LIST") });

        SecurityContext secureContext = new SecurityContextImpl();
        secureContext.setAuthentication(auth);
        SecurityContextHolder.setContext(secureContext);

    }
View Full Code Here

Examples of org.springframework.security.context.SecurityContextImpl

    /**
     * Removed the Acegi SecureContext from the ContextHolder
     */
    private void destroySecureContext() {
        SecurityContextHolder.setContext(new SecurityContextImpl());
    }
View Full Code Here

Examples of org.springframework.security.context.SecurityContextImpl

                username,
                new GrantedAuthority[] {
                        new GrantedAuthorityImpl("ROLE_TELLER"),
                        new GrantedAuthorityImpl("ROLE_PERMISSION_LIST") });

        SecurityContext secureContext = new SecurityContextImpl();
        secureContext.setAuthentication(auth);
        SecurityContextHolder.setContext(secureContext);

    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.