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.
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.
Just realized that CMIS doesnt add the auth header to connection request headers. something is wrong....
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.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.