Error 401 Invalid Login
Contents |
error error status: 401 for http://xxxxx:4984/db/_session. Reason: Unauthorized07-11 04:41:29.827 26475-26632/? E/Sync﹕ com.couchbase.lite.replicator.ReplicationInternal$4@285f487d: Session check
Twitter Error 401
failed org.apache.http.client.HttpResponseException: Unauthorized I can also see the same error magicjack error 401 in sync logs --> 401 Invalid login (0.2 ms)2015-07-11T19:09:11.788+05:30 HTTP auth failed for username when i pof server error 401 revert to older version of sync gateway all works fine. i am using couchbase server 3.03 (latest stable ver) i can also see session being made https://community.tenable.com/thread/8720 in database for the username i am using webhooks could that be the reasonPlease help me as i need to use latest version of sync gateway and cannot revert to old. my syncconfig file is same is there anything special that need to changed for latest syncgateway version. ThanksArjun jamiltz 2015-07-12 11:40:32 UTC https://forums.couchbase.com/t/updating-to-sync-gateway-1-1-gives-error-status-401/4466 #2 Hi @arjunblue, Can you try to login with curl. For an existing user named joe, it would be: curl -vX POST -H 'Content-Type: application/json' \ :4984/db/_session \ -d '{"name": "joe", "password": "letmein"}' > POST /db/_session HTTP/1.1 > User-Agent: curl/7.37.1 > Host: :4984 > Accept: */* > Content-Type: application/json > Content-Length: 39 > * upload completely sent off: 39 out of 39 bytes < HTTP/1.1 200 OK < Content-Length: 103 < Content-Type: application/json * Server Couchbase Sync Gateway/1.1.0 is not blacklisted < Server: Couchbase Sync Gateway/1.1.0 < Set-Cookie: SyncGatewaySession=6c52b8cd2c706d55e97d9606058c0abd90a5d200; Path=/db/; Expires=Tue, 07 Jul 2015 08:23:03 UTC < Date: Mon, 06 Jul 2015 08:23:03 GMT < * Connection #0 to host left intact {"authentication_handlers":["default","cookie"],"ok":true,"userCtx":{"channels":{"!":1},"name":"joe"}}⏎ If you get a 200 OK in the response, you could try using a network inspection tool like httpScoop or Charles to see what the Android SDK is sending and compare with the curl request. James arjunblue 2015-07-13 06:55:20 UTC #3 Hi @jamiltz,
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss http://stackoverflow.com/questions/11714485/restful-login-failure-return-401-or-custom-response the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each error 401 other. Join them; it only takes a minute: Sign up RESTful Login Failure: Return 401 or Custom Response up vote 21 down vote favorite 4 This is a conceptual question. I have a client (mobile) application which needs to support a login action against a RESTful web service. Because the web service is RESTful, this amounts to the client error 401 invalid accepting a username/password from the user, verifying that username/password with the service, and then just remembering to send that username/password with all subsequent requests. All other responses in this web service are provided in a JSON format. The question is, when I query the web service simply to find out whether a given username/password are valid, should the web service always respond with JSON data telling me its successful or unsuccessful, or should it return HTTP 200 on good credentials and HTTP 401 on bad credentials. The reason I ask is that some other RESTful services use 401 for bad credentials even when you're just asking if the credentials are valid. However, my understanding of 401 responses are that they represent a resource that you are not supposed to have access to without valid credentials. But the login resource SHOULD be accessible to anyone because the entire purpose of the login resource is to tell you if your credentials are valid. Put another way, it seems to me that a request like: myservice.com/this