Package org.apache.slide.authenticate

Examples of org.apache.slide.authenticate.CredentialsToken


            principal = (Principal) session.getAttribute(PRINCIPAL_ATTRIBUTE);
        } else {
            session.setAttribute(PRINCIPAL_ATTRIBUTE, principal);
        }
       
        CredentialsToken credentials;
        if (principal == null) {
            credentials = new CredentialsToken("");
        } else {
            credentials = new CredentialsToken(principal);
        }
       
        SlideToken token = new SlideToken(credentials);
        token.setEnforceLockTokens(true);
       
View Full Code Here


     * @param principal Principal for whom the role is to be checked
     * @param role Security role to be checked
     */
    public boolean hasRole(Principal principal, String role) {

        CredentialsToken credToken = new CredentialsToken(principal);
        SlideToken slideToken = new SlideToken(credToken);
        try {
            return securityHelper.hasRole(slideToken, role);
        } catch (SlideException e) {
            return (false);
View Full Code Here

     * Return the password associated with the given principal's user name.
     */
    protected String getPassword(String username) {
       
        Principal userPrincipal = getPrincipal(username);
        CredentialsToken credToken = new CredentialsToken(userPrincipal);
        SlideToken slideToken = new SlideToken(credToken);
       
        // Fetch the Slide object representing the user.
        try {
           
View Full Code Here

            Structure structure = token.getStructureHelper();
            Security security = token.getSecurityHelper();
            Lock lock = token.getLockHelper();
            Content content = token.getContentHelper();
           
            CredentialsToken credToken =
                new CredentialsToken(new String("root"));
            SlideToken slideToken = new SlideToken(credToken);
           
            System.out.println("Creating a test subject");
           
            SubjectNode subject = new SubjectNode();
View Full Code Here

        if (token == null)
            throw new IllegalArgumentException
                ("Unknown namespace : " + namespaceName);

        CredentialsToken credToken = null;

        if (principal == null) {
            credToken = new CredentialsToken("");
        } else {
            credToken = new CredentialsToken(principal);
        }

        this.slideToken = new SlideToken(credToken);
        this.slideToken.setEnforceLockTokens(false);
View Full Code Here

            Structure structure = token.getStructureHelper();
            Security security = token.getSecurityHelper();
            Lock lock = token.getLockHelper();
            Content content = token.getContentHelper();
           
            CredentialsToken credToken =
                new CredentialsToken(new String("root"));
            SlideToken slideToken = new SlideToken(credToken);
           
            System.out.println("Loading objects from XML file");
           
            token.importData(slideToken, new FileReader("Import.xml"));
View Full Code Here

            // start the transaction, NOTE some operations are outside this TA
            token.begin();
           
            getLogger().log("Import data into namespace " + getName(),LOG_CHANNEL,Logger.INFO);
            token.importData
                (new SlideToken(new CredentialsToken(new String("/"))),
                 namespaceBaseDataDefinition);
           
            // end the transaction, NOTE some operations are outside this TA
            token.commit();
View Full Code Here

           
            // start the transaction, NOTE some operations are outside this TA
            token.begin();
           
            token.importData
                (new SlideToken(new CredentialsToken(new String("/"))),
                 namespaceBaseDataDefinition);
           
            // end the transaction, NOTE some operations are outside this TA
            token.commit();
View Full Code Here

           
            // start the transaction, NOTE some operations are outside this TA
            token.begin();
           
            token.importData
                (new SlideToken(new CredentialsToken(new String("/"))),
                 namespaceBaseDataDefinition);
           
            // end the transaction, NOTE some operations are outside this TA
            token.commit();
           
View Full Code Here

        if (token == null)
            throw new IllegalArgumentException
                ("Unknown namespace : " + namespaceName);

        CredentialsToken credToken = null;

        if (principal == null) {
            credToken = new CredentialsToken("");
        } else {
            credToken = new CredentialsToken(principal);
        }

        this.slideToken = new SlideToken(credToken);
        this.slideToken.setEnforceLockTokens(false);
View Full Code Here

TOP

Related Classes of org.apache.slide.authenticate.CredentialsToken

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.