CmisUnauthorizedException - connecting to sharepoint

163 views Asked by At

I am using CMIS to connect with SharePoint. I am getting Unauthorized exception while creating session in SharePoint, So I couldn't upload the document in SharePoint. I am using NTML authentication to connect with SharePoint, but it's not authenticating the user, I am using default NTML implantation from CMIS CmisBindingFactory.NTLM_AUTHENTICATION_PROVIDER _ is it supporting NTLM authentication? if not how to implement NTML authentication in CMIS?

Please find the below code which I have tried.

SessionFactory sessionFactory = SessionFactoryImpl.newInstance();
    Map<String, String> parameter = new HashMap<>();
    parameter.put(SessionParameter.ATOMPUB_URL,
        url);
    
    parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
    // activate the OpenCMIS NTLM authentication provider.
    parameter.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS,
        CmisBindingFactory.NTLM_AUTHENTICATION_PROVIDER);
    // Session locale.
    parameter.put(SessionParameter.LOCALE_ISO3166_COUNTRY, "");
    parameter.put(SessionParameter.LOCALE_ISO639_LANGUAGE, "en");
    parameter.put(SessionParameter.LOCALE_VARIANT, "US");
    parameter.put(SessionParameter.USER, userName);
    parameter.put(SessionParameter.PASSWORD, password);

Session session = sessionFactory.createSession();

1

There are 1 answers