09-07-2017 01:45 PM
I am writing a service that talks to Alfresco Core repository using Apache Chemistry opencmis library and need to authenticate through SPNEGO. Cmis library requires me to provide custom authentication provider which so far doesn't work for me. So far I came up with following:
public class KerberosAuthProvider extends AbstractAuthenticationProvider {
@Override
public Map<String, List<String>> getHTTPHeaders(String url) {
try {
String authToken = …. // generate token
Map<String, List<String>> headers = Maps.newHashMap();
headers.put("Authorization", Lists.newArrayList("Negotiate " + authToken));
return headers;
} catch (Exception ex) {
throw new IllegalStateException("Couldn't get token", ex); }}
}
I will appreciate any suggestions.
09-07-2017 05:29 PM
Suggestions for what? I can only suggest to work through the JAAS / GSS-API tutorials and guides from Oracle. That should be all you need to authenticate as a client and obtain a service ticket for a particular Alfresco instance. There are also StackOverflow questions / answers that cover this.
09-08-2017 01:50 AM
09-08-2017 09:57 AM
Keep in mind that I am using OpenCMIS library. So just need to extend it with my auth provider that implements certain interface. I know how to generate token. For some reason it is not included with the connection, which is where i would appreciate some suggestions from people experienced with CMIS.
09-08-2017 09:51 AM
Just realized that CMIS doesnt add the auth header to connection request headers. something is wrong....
Explore our Alfresco products with the links below. Use labels to filter content by product module.