cancel
Showing results for 
Search instead for 
Did you mean: 

Cmis 1.1 password with special character

mundi
Champ in-the-making
Champ in-the-making
Hello,

After switching from CMIS 1.0 to CMIS 1.1 I am no longer able to use special chacters in the password to log in (for example "andré" as password).
With CMIS 1.0 this was possible.
Does anyone knows if there is a possiblity to do this in CMIS 1.1? Do I have to encode my password somehow (I tried with "andré", "andr\\u00E9", …)?

Here my implementation to create the alfresco session


private Session createSession(String username, String password) {
    SessionFactory sessionFactory = SessionFactoryImpl.newInstance();

    Map<String, String> parameters = new HashMap<String, String>();
    parameters.put(SessionParameter.READ_TIMEOUT, String.valueOf(60000));

    //User credentials.
    parameters.put(SessionParameter.USER, username);
    parameters.put(SessionParameter.PASSWORD, password); //password is "andré"

    //CMIS 1.1 browser binding
    parameters.put(SessionParameter.BINDING_TYPE, BindingType.BROWSER.value());
    parameters.put(SessionParameter.BROWSER_URL, getAlfrescoServerUrl() + "/alfresco/api/-default-/public/cmis/versions/1.1/browser"); // URL to your CMIS server.

    parameters.put(SessionParameter.AUTH_HTTP_BASIC, "true");
    parameters.put(SessionParameter.COOKIES, "true");

    //Set the alfresco object factory
    try {
            Repository repository = sessionFactory.getRepositories(parameters).get(0);
            return repository.createSession();
    }catch (CmisUnauthorizedException e){
            log.log(Level.WARNING, "createSession(" + username + ").CmisUnauthorizedException.returning NULL-session");
    } catch (CmisPermissionDeniedException e) {
            log.log(Level.WARNING, "createSession(" + username + ").CmisPermissionDeniedException.returning NULL-session");
    }
    return null;
}
1 REPLY 1

cbathe
Champ in-the-making
Champ in-the-making
Hello,
we are confronted with a similar problem but we are using CMIS 1.0.
Our .NET-WebApi is accessing the Alfresco-Repository via DotCMIS and checks if the user can authenticate with the provided username and password.
In most cases this works out fine. However some special characters seem to be transferred corrupted.
If the password contains a '§' f.e. the authentication failes. Other characters like '$' or '!' are no problem.
I tried several ways like url-encoding, explicit encoding to UTF-8 etc. None of the ways succeeded.
Login via the Alfresco-Share frontend is working fine even with '§'.

This is a part of the C#-code we are using to check the credentials:

                parameters[DotCMIS.SessionParameter.BindingType] = BindingType.AtomPub;
                parameters[DotCMIS.SessionParameter.AtomPubUrl] = "http://servername:8080/alfresco/cmisatom";
                parameters[DotCMIS.SessionParameter.User] = userName;
                parameters[DotCMIS.SessionParameter.Password] = password;

                Logging.Debug("Vor SessionFactory.NewInstance()");
                SessionFactory factory = SessionFactory.NewInstance();
                Logging.Debug("Vor GetRepositories()");
                ISession session = factory.GetRepositories(parameters)[0].CreateSession();
                Logging.Debug("Vor GetRootFolder()");
                IFolder root = session.GetRootFolder();
                Logging.Debug("Vor GetChildren()");
                IItemEnumerable<ICmisObject> childrens = root.GetChildren();

Alfresco Version is 5.0d.

Is this a known issue and is there any workaround with CMIS?

Greetings,
Christian