Question
cognizant technology solutions
IN
Last activity: 28 Sep 2015 8:59 EDT
Authentication failure
Hi,
I already have ConnectSDK for ios but when I am trying to authenticate using the url "https://test.server.com:8243/prweb/api/v1", user name "admin@docteam",password "rules" I am getting
error :
Error..Error Domain=kCFErrorDomainCFNetwork Code=310 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 310.)" UserInfo=0x7f96dae57450 {_kCFStreamErrorCodeKey=-2096, _kCFStreamErrorDomainKey=4}
Can anyone help?
Thanks,
Moumita
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
GB
I'm not sure what the message means: but do you also get the same thing if you use HTTP (as opposed to HTTPS) ?
I just wonder whether you have a self-signed certificate on your test server and when you test from your phone (are you testing from a real physical phone?) it will reject this for security reasons ?
Additionally (I'm not an iOS programmer, so I could be way-off here) the code=310 suggests (maybe?) you have a PROXY issue ?
From here:
CFNetwork Error Codes Reference
/* HTTP errors */
kCFErrorHTTPAuthenticationTypeUnsupported = 300,
kCFErrorHTTPBadCredentials = 301,
kCFErrorHTTPConnectionLost = 302,
kCFErrorHTTPParseFailure = 303,
kCFErrorHTTPRedirectionLoopDetected = 304,
kCFErrorHTTPBadURL = 305,
kCFErrorHTTPProxyConnectionFailure = 306,
kCFErrorHTTPBadProxyCredentials = 307,
kCFErrorPACFileError = 308,
kCFErrorPACFileAuth = 309,
kCFErrorHTTPSProxyConnectionFailure = 310,
[...]
cognizant technology solutions
IN
Hi,
I tried with Http in ios simulator and I am getting the following error:
Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: bad gateway (502)" UserInfo=0x7fde63f3b470 {NSUnderlyingError=0x7fde63fc6630 "Request failed: unacceptable content-type: text/html", com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x7fde664358a0> { URL: http://test.server.com:8243/prweb/api/v1/authenticate } { status code: 502, headers {
"Cache-Control" = "no-store";
"Content-Language" = en;
"Content-Length" = 666;
"Content-Type" = "text/html";
Date = "Tue, 22 Sep 2015 11:08:23 GMT";
"Proxy-Connection" = close;
Via = "1.1 CTSINBLRVWCGL";
Hi,
I tried with Http in ios simulator and I am getting the following error:
Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: bad gateway (502)" UserInfo=0x7fde63f3b470 {NSUnderlyingError=0x7fde63fc6630 "Request failed: unacceptable content-type: text/html", com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x7fde664358a0> { URL: http://test.server.com:8243/prweb/api/v1/authenticate } { status code: 502, headers {
"Cache-Control" = "no-store";
"Content-Language" = en;
"Content-Length" = 666;
"Content-Type" = "text/html";
Date = "Tue, 22 Sep 2015 11:08:23 GMT";
"Proxy-Connection" = close;
Via = "1.1 CTSINBLRVWCGL";
} }, NSErrorFailingURLKey=http://test.server.com:8243/prweb/api/v1/authenticate, com.alamofire.serialization.response.error.data=<3c484541 443e3c54 49544c45 3e436f6e 6e656374 696f6e20 72656675 7365643c 2f544954 4c453e3c 2f484541 443e0a3c 424f4459 20424743 4f4c4f52 3d227768 69746522 20464743 4f4c4f52 3d22626c 61636b22 3e3c4831 3e436f6e 6e656374 696f6e20 72656675 7365643c 2f48313e 3c48523e 0a3c464f 4e542046 4143453d 2248656c 76657469 63612c41 7269616c 223e3c42 3e0a4465 73637269 7074696f 6e3a2043 6f6e6e65 6374696f 6e207265 66757365 643c2f42 3e3c2f46 4f4e543e 0a3c4852 3e0a3c21 2d2d2064 65666175 6c742022 436f6e6e 65637469 6f6e2072 65667573 65642220 72657370 6f6e7365 20283530 3229202d 2d3e0a3c 2f424f44 593e0a20 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 2000>, NSLocalizedDescription=Request failed: bad gateway (502)}
Pegasystems Inc.
GB
What happens if you put the URL "http://test.server.com:8243/prweb/api/v1/authenticate" into a standard desktop browser ?
cognizant technology solutions
IN
getting the same error in simulator and in browser getting "connection refused" error
Pegasystems Inc.
GB
What happens if you put the URL "http://test.server.com:8243/prweb/api/v1/authenticate" into a standard desktop browser ?
Actually: strike that - try this instead:
1. Login to your PRPC system (I assume it is 718 or 719?) using the OOTB [email protected]/rules operator.
2. Choose the menu option: Resources > Pega API:
3.On the Pega API landing page: choose the first method 'authenticate' and click the 'Try it Out!' button.
This should (on the first use) prompt you for a username and password - then show whether the username/password was valid or not - subsequent tries should just re-use the same (stored as a base64-encoded header) username/password each time:
What happens if you put the URL "http://test.server.com:8243/prweb/api/v1/authenticate" into a standard desktop browser ?
Actually: strike that - try this instead:
1. Login to your PRPC system (I assume it is 718 or 719?) using the OOTB [email protected]/rules operator.
2. Choose the menu option: Resources > Pega API:
3.On the Pega API landing page: choose the first method 'authenticate' and click the 'Try it Out!' button.
This should (on the first use) prompt you for a username and password - then show whether the username/password was valid or not - subsequent tries should just re-use the same (stored as a base64-encoded header) username/password each time:
This should work if you have setup the Pega API correctly : it looks like the 'ConnectSDK' relies on the Pega API being up and running.
See this article for more information about the Pega API : https://mesh.pega.com/docs/DOC-79553
cognizant technology solutions
IN
Hi,
Do you mean that we have to set up our own pega environment and url instead of use this http://test.server.com:8243/prweb/api/v1/authenticate
url.
thanks,
Moumita
Pegasystems Inc.
GB
Hi,
Do you mean that we have to set up our own pega environment and url instead of use this http://test.server.com:8243/prweb/api/v1/authenticate
url.
It looks that way - I hadn't realised that this 'test.server.com' wasn't something you had set up : in fact it doesn't appear to be available on the internet - probably just a test setting that you need to change ?
I can't reach that server either on that port either.
I get an error such as:
//
No connection could be made because the target machine actively refused it
//
Pegasystems Inc.
GB
Looks 'test.server.com' maps to localhost ? Maybe this is a special DNS thing ?
You will definately need to change that to a host which is running PRPC718 or above though by the look of it.
dig test.server.com ; <<>> DiG 9.7.3 <<>> test.server.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38565 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;test.server.com. IN A ;; ANSWER SECTION: test.server.com. 3599 IN A Proprietary information hidden ;; Query time: 108 msec ;; SERVER: Proprietary information hidden#53( Proprietary information hidden) ;; WHEN: Tue Sep 22 15:48:38 2015 ;; MSG SIZE rcvd: 49
cognizant technology solutions
IN
We are trying to set up our middleware .Can you connect me with somebody who can help us to consume webservices in pega platform.
Pegasystems Inc.
US
this looks like an native ios application you are building. Did this call reach the backend Pega server? If not, it appears to be some kind of proxy server configuration issue (is there any?, if yes, logs from the proxy server might help).
cognizant technology solutions
IN
Hi Kevin,
Thanks for your reply.Yes I it is a native ios application.But how can I check the call is reached to backend pega server or not?I dont have access to the log of proxy server.
Thanks,
Moumita
Pegasystems Inc.
US
In order to isolate if this is env specific, try to use an independent rest client (e.g., chrome rest client) to access the same url - I expect the same error if this is env specific.
Updated: 22 Sep 2015 10:02 EDT
Pegasystems Inc.
GB
It does look to be a server-error (proxy?) of somesort : that weird error message actually contains hexcodes for a message, and can be decoded as follows:
<HEAD><TITLE>Connection refused</TITLE></HEAD> <BODY BGCOLOR="white" FGCOLOR="black"><H1>Connection refused</H1><HR> <FONT FACE="Helvetica,Arial"><B> Description: Connection refused</B></FONT> <HR> <!-- default "Connection refused" response (502) --> </BODY>
I just extracted the hex-strings out of the original error and swapped out the space for a newline; and ran it through the following Python script to get this:
import re chars=[] for line in open("response.txt"): digit_pairs=re.findall( '..', line ) for digit in digit_pairs: chars.append( chr( int(digit, 16) ) ) print "".join( chars )
cognizant technology solutions
IN
Hi,
I tried it to run in actual device connected to open wifi network and getting error:
Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo=0x14eacce0 {NSErrorFailingURLStringKey=http://test.server.com:8243/prweb/api/v1/authenticate, _kCFStreamErrorCodeKey=61, NSErrorFailingURLKey=http://test.server.com:8243/prweb/api/v1/authenticate, NSLocalizedDescription=Could not connect to the server., _kCFStreamErrorDomainKey=1, NSUnderlyingError=0x14e98af0 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1004.)"}
I tried
GET /prweb/api/v1/authenticate HTTP/1.1
Host: test.server.com:8243
Authorization: Basic YWRtaW5AZG9jdGVhbTpydWxlcw==
Cache-Control: no-cache
Postman-Token: ccea4129-6dfe-c911-2990-7331f07da366
in postman for crome I am getting the error:
Hi,
I tried it to run in actual device connected to open wifi network and getting error:
Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo=0x14eacce0 {NSErrorFailingURLStringKey=http://test.server.com:8243/prweb/api/v1/authenticate, _kCFStreamErrorCodeKey=61, NSErrorFailingURLKey=http://test.server.com:8243/prweb/api/v1/authenticate, NSLocalizedDescription=Could not connect to the server., _kCFStreamErrorDomainKey=1, NSUnderlyingError=0x14e98af0 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1004.)"}
I tried
GET /prweb/api/v1/authenticate HTTP/1.1
Host: test.server.com:8243
Authorization: Basic YWRtaW5AZG9jdGVhbTpydWxlcw==
Cache-Control: no-cache
Postman-Token: ccea4129-6dfe-c911-2990-7331f07da366
in postman for crome I am getting the error:
There seems to be like an error connecting to: http://test.server.com:8243/prweb/api/v1/authenticate.
Could it be possible that this particular url is not running over the internet?
Thanks,
Moumita
Pegasystems Inc.
US
The port 8243 is not listening. can u try port 80?
cognizant technology solutions
IN
I tried port 80 but getting the same error..
Pegasystems Inc.
US
In that case, you try contact whoever setup the service.
cognizant technology solutions
IN
Yah we are trying to setup our middleware.
cognizant technology solutions
IN
Hi,
Can you connect me with somebody who can help us to consume webservices in pega platform?
Thanks,
Moumita
Pegasystems Inc.
GB
Hi Moumita - do you have a specific question on how to consume webservices in Pega ? If so : you probably want to create a separate post on this forum detailing what information you need etc ?
Thanks,
John
Pegasystems Inc.
US
create an SR if you need further help, make sure you add details of how testserver is setup in your environment.