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 SlideTokenImpl(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 SlideTokenImpl(credToken);
       
        // Fetch the Slide object representing the user.
        try {
           
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 SlideTokenImpl(credToken);
        this.slideToken.setEnforceLockTokens(false);
View Full Code Here

                       String sourcerevision,
                       String sourcerevisionbranch) throws SourceException {

        this.sourcecredential = sourcecredential;

        this.credToken = new CredentialsToken(this.sourcecredential.getPrincipal());
        this.nat = nat;
        this.config = this.nat.getNamespaceConfig();
        this.scheme = scheme;
        this.path = path;
        this.uri = scheme+":/"+path;
View Full Code Here

            (sourcecredential.getPrincipal().length()<=0)) {
            return;
        }

        this.sourcecredential = sourcecredential;
        this.credToken = new CredentialsToken(this.sourcecredential.getPrincipal());
        this.slideToken = new SlideTokenImpl(credToken);
    }
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

            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

        else if( P_GETCONTENTLANGUAGE.equals(propName) ) {
            result = "en";
        }
        else if( P_CREATOR_DISPLAYNAME.equals(propName) ) {
            if( sToken != null ) {
                CredentialsToken credToken = sToken.getCredentialsToken();
                if( credToken != null ) {
                    Principal p = credToken.getPrincipal();
                    if( p != null )
                        result = p.getName();
                    else
                        result = SubjectNode.UNAUTHENTICATED_URI;
                }
View Full Code Here

                       String sourcerevision,
                       String sourcerevisionbranch) throws SourceException {

        this.sourcecredential = sourcecredential;

        this.credToken = new CredentialsToken(this.sourcecredential.getPrincipal());
        this.nat = nat;
        this.config = this.nat.getNamespaceConfig();
        this.scheme = scheme;
        this.path = path;
        this.uri = scheme+":/"+path;
View Full Code Here

            (sourcecredential.getPrincipal().length()<=0)) {
            return;
        }

        this.sourcecredential = sourcecredential;
        this.credToken = new CredentialsToken(this.sourcecredential.getPrincipal());
        this.slideToken = new SlideTokenImpl(credToken);
    }
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.