0

I'm working on a web app that grabs data from an iOS app using CloudKit. As part of the application, they must login using their AppleID. However, when I try to login, I'm getting a 404. I request the following URL:

https://api.apple-cloudkit.com/1/[mycontainer]/development/users/current?ckAPIToken=[mytoken]

I get back an object that looks like this:

{
  "uuid" : "123-abc",
  "serverErrorCode" : "AUTHENTICATION_REQUIRED",
  "reason" : "request needs authorization",
  "redirectURL" : "https://idmsa.apple.com/IDMSWebAuth/auth2?oauth_token=OATTKN49471611-really-long-alpha-code"
}

However, when I redirect the user to the "redirectURL" parameter, I'm getting a blank 404 page. Inspecting the page, idmsa.apple.com loads, but when the JavaScript on the page requests signin?widgetKey={key} it gets a 404.

UPDATE: I'm not sure if this helps, but the https://idmsa.apple.com/IDMSWebAuth/auth2?oauth_token=[TOKEN] loads fine. However, that page uses JavaScript to load https://idmsa.apple.com/appleauth/auth/signin?widgetKey=[widgetkey]&locale=US-EN which is failing with a 404. However, it's only failing for me and seems to work for others.

Dexter
  • 1,128
  • 3
  • 25
  • 51
  • how are you making the request? I had some errors before getting it to work, it needs to run on port 80 or 443 – Simon Aug 17 '15 at 12:48
  • I'm using cURL to make the initial request. Once I get back the redirect URL, i'm using a 301 redirect to send them directly to the authentication page. I'm making the initial cURL request over port 80 I believe. – Dexter Aug 17 '15 at 14:45
  • Have you found a workaround? I'm still getting the blank page. Just in case, I'm using https://github.com/jaumecornado/DroidNubeKit. As the last commit was 2 years ago, I'm not sure if something else has changed. Thanks in advance – Juan Giorello Feb 09 '17 at 14:43

2 Answers2

2

Apparently this was a bug with Apple's CloudKit service. They are aware of the issue and have been working on a fix.

Dexter
  • 1,128
  • 3
  • 25
  • 51
0

I was receiving the same 404 error. Seems to be intermittent, they are probably fixing it.

cxca
  • 46
  • 4