cancel
Showing results for 
Search instead for 
Did you mean: 

Login not allowed

johannesschacht
Champ in-the-making
Champ in-the-making
I am trying to log into the public Alfresco server using the .dotCMIS api. The code I am using did work a year ago and I can log in using the CMIS workbench. I'm puzzled and hope someone can help me.

This is my code:


            Dictionary<string, string> parameters = new Dictionary<string, string>();

            parameters[SessionParameter.BindingType] = BindingType.AtomPub;
            parameters[SessionParameter.AtomPubUrl] = "http://cmis.alfresco.com/cmisatom";
            parameters[SessionParameter.User] = "admin";
            parameters[SessionParameter.Password] = "admin";

            SessionFactory factory = SessionFactory.NewInstance();
            var x = factory.GetRepositories(parameters);
2 REPLIES 2

steven_okennedy
Star Contributor
Star Contributor
Hi,

Not sure what's happening here - I don't use DotCMIS but I've tried the equivalent code in OpenCMIS (Java) which works without problems


        Map<String, String> parameters = new HashMap<String, String>();
      
        parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
        parameters.put(SessionParameter.ATOMPUB_URL, "http://cmis.alfresco.com/cmisatom");
        parameters.put(SessionParameter.USER, "admin");
        parameters.put(SessionParameter.PASSWORD, "admin");

        SessionFactory factory = SessionFactoryImpl.newInstance();
        List<Repository> repos = factory.getRepositories(parameters);


What error do you get back when you attempt to get the repositories back?

One thing is that the url of the CMIS endpoints has changed e.g. the url is now https://cmis.alfresco.com/alfresco/api/-default-/public/cmis/versions/1.1/atom for CMIS 1.1 or https://cmis.alfresco.com/alfresco/api/-default-/public/cmis/versions/1.0/atom for CMIS version 1.0, however the older style url is still backward compatible enough to work right now as the Java code above works

Regards

Steven

When I use the new URL I can connect! It's a bit strange. Thanks for pointing me to it. (The error message was "Unauthorized").

Another observation: The repository does neither have a name nor a display name, both are empty strings.