问题
When I'm trying to use POST
to get the Auth token from the ac2dm service I only get the SID and LSID, not the Auth, has this happened to anyone else, if yes, how did you solve this?
I'm using .NET (C#) on the server side, I have tried to send the post call with fiddler to but I'm getting the same result.
Post call in fiddler:
Content-Type: application/x-www-form-urlencoded Host: www.google.com Content-Length: 125 Expect: 100-continue
accountType=HOSTED_OR_GOOGLE&Email=myRegistredMail&Passwd=myPassword&Service=ac2dm&source=myAppPackageName
and the response (i get response code 200 so it should work):
SID=DQAAAMgAAADhKR...
LSID=DQAAAMoAAACCR...
as you can see there is no Auth token in the response...
回答1:
Its as simple as big and small letters... It should be service with a small "s" and Source with a big "S".
Thanx to MightyPush at android-c2dm group for pointing this out:)
回答2:
Also if you are seeing the spanish documentation, instead of service it is wrote that you must use servicio, but this does not work.
So for this to work, the keywords are
- accountType
- Passwd
- service
- source
来源:https://stackoverflow.com/questions/5728441/no-auth-in-c2dm-response