Http Error 401 Android
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us android gcm unauthorized error 401 Learn more about Stack Overflow the company Business Learn more about hiring developers unauthorized error 401 android push notification or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack
Error: Received Error Code 401 From Gcm Service
Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Google GCM server returns Unauthorized Error 401 up
Unauthorized Error 401 Android Push Notification Php
vote 26 down vote favorite 6 I am using GCM services to push information from server. If I use browser key it shows the sucess mesaage as : {"multicast_id":4849013215736515938,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1348742583011905%2adac3a0f9fd7ecd"}]} but i did not get any notifications on device. And if I use server key it shows Unauthorized Error 401. My code is shown below: $apiKey = "xxxxx"; $registrationIDs = array("xxxxxxxx"); $message = "testing Process"; $url = 'https://android.googleapis.com/gcm/send'; how to fix error 401 $fields = array( 'registration_ids' => $registrationIDs, 'data' => array("message"=>$message), ); $headers = array( 'Authorization: key=' . $apiKey, 'Content-Type: application/json' ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $url ); curl_setopt( $ch, CURLOPT_POST, true ); curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode($fields) ); $result = curl_exec($ch); if(curl_errno($ch)){ echo 'Curl error: ' . curl_error($ch); } curl_close($ch); echo $result; Please help me for this issue. Thanks in advance. php android json google-cloud-messaging share|improve this question asked Sep 27 '12 at 10:56 Sushil Kandola 6102821 refer this stackoverflow.com/a/21628030/1765530 –appukrb Feb 7 '14 at 12:41 can u make a small step list of google configuration? –valeriocomo Apr 15 '15 at 19:09 add a comment| 13 Answers 13 active oldest votes up vote 27 down vote accepted Did you whitelist the IP of your server? This is not necessary by default for the browser key, but it is for the server key. You can check it here: https://code.google.com/apis/console/#project:[YOUR PROJECT NUMBER]:access share|improve this answer answered Jan 3 '13 at 9:00 Jos 603818 1 Thank you all guys. I was facing the problem due to browser key and A
Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring
Network Error 401 Unauthorized
developers or posting ads with us Android Enthusiasts Questions Tags Users Badges Unanswered Ask Question gcm 401 _ Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. Join them; it there was a problem with the network 401 youtube only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top YouTube 401 error up vote 0 down vote favorite It http://stackoverflow.com/questions/12619759/google-gcm-server-returns-unauthorized-error-401 told it was a network error, so I waited for about 2 days assuming that it would have to do something with the network, but my internet has been functional. I'm presenting the screenshot that I took now , I'm writing question from my mobile and there's no network problem as I'm able to write it , then what's the problem and how to fix it? I did a Google search but all the issues were 4 years back, http://android.stackexchange.com/questions/142595/youtube-401-error every body is talking about gingerbread in those posts, I'm running Android lollipop! youtube share|improve this question edited Apr 17 at 9:59 Izzy♦ 63.2k31158450 asked Apr 17 at 9:15 brainst 112 Not using that – but when reading "network error" and "401" in one line, it lets me think of the HTTP response code (which means "authorization required"). Have you tried logging-out/logging-in from the YT app? It's just a wild guess, as a "wrong password" should result in a 403 (not 401). –Izzy♦ Apr 17 at 10:01 just logout from YouTube ,it will fix the problem. –user177190 Jul 18 at 20:28 add a comment| 3 Answers 3 active oldest votes up vote 0 down vote If you're internet is otherwise working fine, it looks like it could be an issue with the YouTube App itself. Try clearing cache and data for the YouTube App. This will effectively reset the app back to default settings and you will have to log back in. Go to Settings -> Application Manager -> YouTube -> Storage -> Clear Data and Clear Cache. Hope that helps! share|improve this answer answered Jul 14 at 11:53 altobobcat 63 add a comment| up vote 0 down vote Go on to app store and search YouTube then delete it it will leave you on the last update don't update it as it will start showing the error 401 again share|i
aber der Zugriff auf die URL-Ressource eine Benutzerauthentifizierung verlangt, die 1) bisher nicht zugewiesen wurde oder 2) die zugewiesen wurde, aber die Legitimationsprüfungen nicht bestanden hat. Dies ist allgemein bekannt als http://www.checkupdown.com/status/E401.html "HTTP Basic Authentication". Die tatsächliche vom Client erwartete Authentifizierungsanfrage ist im HTTP-Protokoll als WWW-Authenticate-Header-Feld definiert. Im Allgemeinen bedeutet diese Fehlermeldung, dass Sie sich zuerst irgendwo einloggen müssen (eine gültige Benutzer-ID und ein Passwort eingeben). Wenn Sie diese eingegeben haben und sofort einen 401-Fehler sehen, bedeutet dies, dass entweder Ihre Benutzer-Id oder Ihr Passwort, oder beide, aus irgendeinem Grund ungültig waren (falsche error 401 Eingabe, Benutzer-ID gesperrt usw.). Beheben von 401-Fehlern - allgemein Jeder Webserver verwaltet Benutzerauthentifizierungen auf seine eigene Weise. Üblicherwiese entscheidet ein Sicherheitsbeautragter (z.B. ein Webmaster) der Site, welchen Benutzern Zugriff auf die URL gewährt wird. Diese Person verwendet dann die Webserver-Software, um diese Benutzer und deren Passwörter einzustellen. Wenn Sie nun Zugriff auf die URL haben müssen (oder Sie Ihre Benutzer-ID oder error 401 android Ihr Passwort vergessen haben), kann Ihnen nur der Sicherheitsbeautragte dieser Site helfen. Wenden Sie sich in Sicherheitsfragen direkt an diese Personen. Wenn Sie denken, dass die URL der Webseite für jedermann im Internet zugänglich sein *muss*, dann bedeutet eine 401-Meldung ein ernsteres Problem. Das Erste was Sie machen können, ist Ihre URL mittels eines Webbrowsers zu überprüfen. Dieser Browser sollte auf einem Computer laufen, an dem Sie sich vorher noch nie identifiziert haben und Sie sollten Authentifizierungen (Passwörter usw.) vermeiden, die Sie bereits vorher benutzt haben. Idealerweise sollte dies Alles über eine völlig andere Internetverbindung als alle anderen, die Sie vorher benutzt haben, erfolgen (z.B. ein anderer Telefonanschluss). Kurz gesagt, Sie versuchen die gleiche Reaktion zu erhalten, die ein völlig Fremder erhalten würde, wenn er im Internet zu dieser Webseite surfen würde. Wenn diese Art der Browserprüfung keine Berechtigungsprobleme ergibt, kann es sein, dass der Webserver (oder das umgebende System) so konfiguriert wurden, dass sie bestimmte Muster von HTTP-Verkehr nicht zulassen. Mit anderen Worten, die HTTP-Kommunikation von einem bekannten Webbrowser ist erlaubt, aber die automatisierte Kommunikation von anderen Systemen wird mit