Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E681F200C49 for ; Fri, 17 Mar 2017 10:30:30 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id E513E160B80; Fri, 17 Mar 2017 09:30:30 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 36FF2160B6D for ; Fri, 17 Mar 2017 10:30:30 +0100 (CET) Received: (qmail 43622 invoked by uid 500); 17 Mar 2017 09:30:29 -0000 Mailing-List: contact dev-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list dev@chemistry.apache.org Received: (qmail 43610 invoked by uid 99); 17 Mar 2017 09:30:29 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Mar 2017 09:30:29 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id E89311A03B7 for ; Fri, 17 Mar 2017 09:30:28 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.453 X-Spam-Level: X-Spam-Status: No, score=0.453 tagged_above=-999 required=6.31 tests=[KAM_NUMSUBJECT=0.5, RCVD_IN_DNSWL_LOW=-0.7, SPF_NEUTRAL=0.652, UNPARSEABLE_RELAY=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id wNPHpFTs94Dy for ; Fri, 17 Mar 2017 09:30:27 +0000 (UTC) Received: from plasma31.jpberlin.de (plasma31.jpberlin.de [80.241.56.82]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id ED7405F1BA for ; Fri, 17 Mar 2017 09:30:26 +0000 (UTC) Received: from gerste.heinlein-support.de (gerste.heinlein-support.de [91.198.250.173]) by plasma.jpberlin.de (Postfix) with ESMTP id B6CCA1008E4; Fri, 17 Mar 2017 10:30:20 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from plasma.jpberlin.de ([80.241.56.76]) by gerste.heinlein-support.de (gerste.heinlein-support.de [91.198.250.173]) (amavisd-new, port 10024) with ESMTP id vcaWpgdBB-tB; Fri, 17 Mar 2017 10:30:07 +0100 (CET) Received: from webmail.jpberlin.de (sinatra9.heinlein-hosting.de [80.241.56.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: fmui-mailbox@gotux.de) by plasma.jpberlin.de (Postfix) with ESMTPSA id 8C475100898; Fri, 17 Mar 2017 10:30:07 +0100 (CET) Received: from 4+WcXZVEtv2YKmH4GV9OpPQBzvBACdf5aPTQ9GEA0o8= (mFJ9OqYW/XYq68FIecxboalXOKpirl6o) by webmail.jpberlin.de with HTTP (HTTP/1.1 POST); Fri, 17 Mar 2017 10:30:07 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 17 Mar 2017 10:30:07 +0100 From: =?UTF-8?Q?Florian_M=C3=BCller?= To: dev@chemistry.apache.org Cc: Xi Wang Subject: Re: Authentication error connect to CMIS Web Services endpoint with using DotCMIS v0.7 In-Reply-To: References: Message-ID: X-Sender: fmui@apache.org User-Agent: RoundCube Webmail archived-at: Fri, 17 Mar 2017 09:30:31 -0000 Hi Xi, The Web Services binding uses UsernameToken by default for the authentication (as defined by the CMIS specification). Your server doesn't seem to support that. To turn on HTTP authentication add this line: parameters[SessionParameter.AuthenticationProviderClass] = "DotCMIS.Binding.NtlmAuthenticationProvider"; (Don't be confused by "NTLM". The authentication provider handles both, basic auth and NTLM.) And a final note: Do not use the Web Services binding if you don't have to! It's slow and cumbersome. - Florian > Hi all, > > I tried to use the CMIS Web Service endpoint demo released in > *https://chemistry.apache.org/dotnet/getting-started-with-dotcmis.html > * > to access to my database, but I got the authentication error as below: > The HTTP request is unauthorized with client authentication scheme > 'Anonymous'. The authentication header received from the server was > 'Basic > realm="Authentication required"'. > > I'm sure I have specified the username&pwd correctly to my C# > application, > please see the code below: > > using DotCMIS; > using DotCMIS.Client; > using DotCMIS.Client.Impl; > using System; > using System.Collections.Generic; > using System.Linq; > using System.Text; > using System.Threading.Tasks; > > /* > */ > > namespace testDotCmis > { > class Program > { > static void Main(string[] args) > { > var parameters = new Dictionary(); > > parameters[SessionParameter.BindingType] = > BindingType.WebServices; > parameters[SessionParameter.WebServicesRepositoryService] = > "https://[host address]/repositoryservice?wsdl"; > parameters[SessionParameter.WebServicesAclService] = > "https://[host > address]/aclservice?wsdl"; > parameters[SessionParameter.WebServicesDiscoveryService] = > "https://[host address]/discoveryservice?wsdl"; > parameters[SessionParameter.WebServicesMultifilingService] > = > "https://[host address]/multifilingservice?wsdl"; > parameters[SessionParameter.WebServicesNavigationService] = > "https://[host address]/navigationservice?wsdl"; > parameters[SessionParameter.WebServicesObjectService] = > "https://[host address]/objectservice?wsdl"; > parameters[SessionParameter.WebServicesPolicyService] = > "https://[host address]/policyservice?wsdl"; > parameters[SessionParameter.WebServicesRelationshipService] > = > "https://[host address]/relationshipservice?wsdl"; > parameters[SessionParameter.WebServicesVersioningService] = > "https://[host address]/versioningservice?wsdl"; > parameters[SessionParameter.User] = "[username]"; > parameters[SessionParameter.Password] = "[pwd]"; > > > SessionFactory factory = SessionFactory.NewInstance(); > > var repoInfoList = factory.GetRepositories(parameters); > Console.WriteLine("Test"); > Console.ReadKey(); > } > } > } > > I also tested with Atompub&browser, they worked perfectly. > > var parameters = new Dictionary(); > parameters[SessionParameter.BindingType] = > BindingType.Browser; > parameters[SessionParameter.BrowserUrl] = "https://[host > address]/browser"; > parameters[SessionParameter.User] = "[username]"; > parameters[SessionParameter.Password] = "[pwd]"; > SessionFactory factory = SessionFactory.NewInstance(); > > var repoInfoList = factory.GetRepositories(parameters); > > Could you help with this, please?