Package org.apache.slide.authenticate

Examples of org.apache.slide.authenticate.CredentialsToken


     * @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

     * @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

       
        // Fetch the Slide object representing the user.
        try {
           
            Principal userPrincipal = getPrincipal(username);
            CredentialsToken credToken = new CredentialsToken(userPrincipal);
            SlideToken slideToken = new SlideToken(credToken);
           
            NodeRevisionDescriptors revisionDescriptors =
                contentHelper.retrieve(slideToken, usersPath + "/" + username);
            NodeRevisionDescriptor revisionDescriptor =
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

            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 SlideTokenImpl(credToken);
           
            System.out.println("Creating a test subject");
           
            SubjectNode subject = new SubjectNode();
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 SlideTokenImpl(credToken);
           
            System.out.println("Loading objects from XML file");
           
            token.importData(slideToken, new FileReader("Import.xml"));
View Full Code Here

            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 SlideTokenImpl(credentials);
        token.setEnforceLockTokens(true);
       
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 SlideTokenImpl(new CredentialsToken(new String("/"))),
                 namespaceBaseDataDefinition);
           
            // end the transaction, NOTE some operations are outside this TA
            token.commit();
View Full Code Here

       
        // create a new domain bean
        HttpServletRequest request =
            (HttpServletRequest)context.getRequest();
        Principal principal = request.getUserPrincipal();
        CredentialsToken credentials;
        if (principal == null) {
            credentials = new CredentialsToken("");
        } else {
            credentials = new CredentialsToken(principal);
        }
        SlideToken st = new SlideTokenImpl(credentials);
        return new DomainBean(st);
    }
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.