Developer Forum [ All Topics | New Topic ]

Thread: Cannot Authenticate to start using the web service to upload stones

Hi, I am trying to get an authentication ticket header, but the moment i try to login i get an error msg saying 'Credentials can only be passed over https..' I tried changing the end point address to include https in the uri but that threw a different error. Can you please suggest the right way to authenticate myself without using a generic client request over POST.

>> add a comment
Mukul Pahwa (mukul@77diamonds.com
10/08/2009 11:22


7 Replies:

RE: Cannot Authenticate to start using the web service to upload stones
Hi,

When using web services you need to call a method named “Login” that will authenticate your web service. “Login” returns a ticket which the web service will use for future authentication with our system.

To protect our customer information, our authentication system works only in the HTTPS mode. However we suggest that after obtaining a ticket in the HTTPS mode the program should continue working in the regular HTTP mode using the ticket to authenticate. This allows the web service to work faster. All function except for “Login” can be called both over HTTP and HTTPS.

You can test your username and password by requesting a ticket at https://technet.rapaport.com/HTTP/Authenticate.aspx. Note that tickets expire after one hour.

We have a code example that uploads listings using a web service posted on our site. You can see an example at: http://technet.rapaport.com/Info/LotUpload/SampleCode/webService_Example.aspx
The code is written in C# and .NET but it should be the same concept coding in any other language.

What language are you coding in? What error did you get after changing the web service request to HTTPS? Can you send me your code?

>> add a comment
Eli Sack
10/11/2009 10:00:00 AM
how to Use Authentication Ticket
Hi, I have generated my ticket from https://technet.rapaport.com/HTTP/Authenticate.aspx How can i use the ticket to authenticate for web service call .. ?? Thanks in advance,

>> add a comment
Nikunj Maniar
10/15/2009 2:17:00 AM
You are not authorized to view this page
Hi I am calling web service to get the price But the error is occured You are not authorized to view this page You do not have permission to view this directory or page using the credentials that you supplied. Any idea .. to solve this error

>> add a comment
Nikunj Maniar
10/15/2009 6:24:00 AM
RE: You are not authorized to view this page
Are you calling the login method, or one of the other methods that are only available after you called the login method? Can you post your code here? We have a good example how to do this from within C#: http://technet.rapaport.com/Info/Prices/SampleCode/webService_Example.aspx

>> add a comment
Leo Muller
10/15/2009 7:06:00 AM
RE: how to Use Authentication Ticket
The page that generates the ticket is used mainly to get a ticket so you can get authenticated when running your application. You can also send your user name and password using the POST method. Note, when requesting a ticket or sending user name and password over the POST method you must use the HTTPS protocol. You can see code examples at http://technet.rapaport.com/Info/Prices/SampleCode/Full_Example.aspx

>> add a comment
Eli Sack
10/15/2009 7:22:00 AM
sir , i want to use webservice for "deletedlots".

you said we have to first login with HTTPS authentication.

//This must be done in HTTPS protocol
webServiceManager.Login("myUser", "myPassword");

but above statements gives an error.

in webservice how can we use.

            DiamondManager webServiceManager = new DiamondManager();

            string URLAuth = "https://technet.rapaport.com/HTTP/Authenticate.aspx";
            WebClient webClient = new WebClient();

            NameValueCollection formData = new NameValueCollection();

            formData["Username"] = "xxxxx";
            formData["Password"] = "xxxxxxxxx";
            byte[] responseBytes = webClient.UploadValues(URLAuth, "POST", formData);
            string ResultAuth = Encoding.UTF8.GetString(responseBytes);
            webClient.Dispose();

above coding gives me ticket. but main question is where to use that ticket in webservice ?

DiamondManager webServiceManager = new DiamondManager();
webServiceManager.Login("myUser", "myPassword");


>> add a comment
SB Sir
2/2/2011 5:40:00 AM
Hi

it looks like your getting mixed up with the Web Service and HTTP POST

there is more than one way how to upload diamonds u can use the Web Service and then you will only do a LogIn like in this : http://technet.rapaport.com/Info/LotUpload/SampleCode/webService_Example.aspx

example or you can use the HTTP POST like in this example: http://technet.rapaport.com/Info/LotUpload/SampleCode/Full_Example.aspx

for deleting diamonds you will need to use the web service and not the HTTP POST because that is used only for uploading diamonds

best regards,

Ahaliav Fox



>> add a comment
Ahaliav
2/2/2011 7:16:00 AM