Package org.switchyard.security.credential

Examples of org.switchyard.security.credential.NameCredential


        Set<Credential> creds = new LinkedHashSet<Credential>();
        creds.add(new AssertionCredential(new ElementPuller().pull(new StringReader("<testAssertion/>"))));
        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));
View Full Code Here


                String decoded = Base64.decodeToString(encoded, _charset);
                if (decoded.indexOf(':') != -1) {
                    String[] split = decoded.split(":", 2);
                    String name = split.length > 0 ? split[0] : null;
                    if (name != null) {
                        credentials.add(new NameCredential(name));
                    }
                    String password = split.length > 1 ? split[1] : null;
                    if (password != null) {
                        credentials.add(new PasswordCredential(password));
                    }
                }
            } else if (source.startsWith("Digest ")) {
                // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
                // https://issues.jboss.org/browse/SWITCHYARD-1082
                // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
                Map<String,String> map = new HashMap<String,String>();
                String everything = source.substring(6, source.length()).trim();
                List<String> list = Strings.splitTrimToNull(everything, ",\n");
                for (String pair : list) {
                    String[] split = pair.split("=", 2);
                    String key = split.length > 0 ? split[0] : null;
                    String value = split.length > 1 ? split[1] : null;
                    if (key != null && value != null) {
                        if (value.startsWith("\"") && value.endsWith("\"")) {
                            value = value.substring(1, value.length() - 1);
                        }
                        map.put(key, value);
                    }
                }
                String username = map.get("username");
                if (username != null) {
                    credentials.add(new NameCredential(username));
                }
                // TODO: complete per SWITCHYARD-1082
            }
        }
        return credentials;
View Full Code Here

                                    Node usernameChildNode = usernameChildElements.item(i);
                                    String usernameChildeNodeName = XMLHelper.nameOf(usernameChildNode);
                                    if ("Username".equalsIgnoreCase(usernameChildeNodeName)) {
                                        String name = XMLHelper.valueOf(usernameChildNode.getFirstChild());
                                        if (name != null) {
                                            credentials.add(new NameCredential(name));
                                        }
                                    } else if ("Password".equalsIgnoreCase(usernameChildeNodeName)) {
                                        String password =  XMLHelper.valueOf(usernameChildNode.getFirstChild());
                                        if (password != null) {
                                            credentials.add(new PasswordCredential(password));
View Full Code Here

TOP

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

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.