Package org.switchyard.security.credential

Examples of org.switchyard.security.credential.PrincipalCredential


        } else {
            if (_secured) {
                credentials.add(new ConfidentialityCredential(true));
            }
            if (_principal != null) {
                credentials.add(new PrincipalCredential(_principal, true));
            }
            String charsetName = null;
            List<String> contentTypes = _headers.get("content-type");
            String contentType = null;
            if ((contentTypes != null) && (contentTypes.size() > 0)) {
View Full Code Here


        creds.add(SOAPMessageCredentialExtractorTests.getBinarySecurityTokenCertificateCredential());
        creds.add(new ConfidentialityCredential(true));
        creds.add(new ConfidentialityCredential(false));
        creds.add(new NameCredential("testName"));
        creds.add(new PasswordCredential("testPassword"));
        creds.add(new PrincipalCredential(user, true));
        creds.add(new PrincipalCredential(role, false));
        creds.add(new PrincipalCredential(childGroup, true));
        creds.add(new PrincipalCredential(parentGroup, false));
        Subject childSubject = new Subject();
        childSubject.getPrincipals().add(new UserPrincipal("childUser"));
        creds.add(new SubjectCredential(childSubject));
        return creds;
    }
View Full Code Here

    @Override
    public Set<Credential> extract(SSLSession source) {
        Set<Credential> credentials = new HashSet<Credential>();
        try {
            credentials.add(new ConfidentialityCredential(source.isValid()));
            credentials.add(new PrincipalCredential(source.getPeerPrincipal()));
            credentials.add(new CertificateCredential(source.getPeerCertificates()[0]));
        } catch (SSLPeerUnverifiedException e) {
            throw BaseSecurityMessages.MESSAGES.unableToExtractCredentials(e.getMessage(), e);
        }
        return credentials;
View Full Code Here

            if (protocol != null) {
                credentials.add(new ConfidentialityCredential(protocol.toLowerCase().startsWith("https")));
            }
            Principal principal = source.getPrincipal();
            if (principal != null) {
                credentials.add(new PrincipalCredential(principal, true));
            }
            // TODO: Should we go after this?
            /*
            String remoteUser = source.getRequestHeaders().getFirst("REMOTE_USER");
            if (remoteUser != null) {
View Full Code Here

    public Set<Credential> extract(WebServiceContext source) {
        Set<Credential> credentials = new HashSet<Credential>();
        if (source != null) {
            Principal userPrincipal = source.getUserPrincipal();
            if (userPrincipal != null) {
                credentials.add(new PrincipalCredential(userPrincipal, true));
            }
        }
        return credentials;
    }
View Full Code Here

            }
            if (source instanceof HttpServletRequest) {
                HttpServletRequest request = (HttpServletRequest)source;
                Principal userPrincipal = request.getUserPrincipal();
                if (userPrincipal != null) {
                    credentials.add(new PrincipalCredential(userPrincipal, true));
                }
                String remoteUser = request.getRemoteUser();
                if (remoteUser != null) {
                    credentials.add(new PrincipalCredential(new UserPrincipal(remoteUser), true));
                }
                String charsetName = source.getCharacterEncoding();
                AuthorizationHeaderCredentialExtractor ahce;
                if (charsetName != null) {
                    ahce = new AuthorizationHeaderCredentialExtractor(charsetName);
View Full Code Here

TOP

Related Classes of org.switchyard.security.credential.PrincipalCredential

Copyright © 2018 www.massapicom. 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.