Sign in with Apple REST API

RSS for tag

The Sign in with Apple REST API allows your app's servers to communicate with Apple’s authentication servers.

Posts under Sign in with Apple REST API tag

200 Posts

Post

Replies

Boosts

Views

Activity

Authorization_code validation (auth/token) results invalid_grant
Hi all. In order to prepare for the new "Account deletion guidance", I have been trying to retrieve access_token and refresh_token from the authorization_code but the POST request to https://appleid.apple.com/auth/token always results invalid_grant error. https://developer.apple.com/documentation/sign_in_with_apple/generate_and_validate_tokens I've tested with fresh authorization_codes that were not expired and generated by actual devices (not simulators), but I always end up with "The code has expired or has been revoked" message. Can somebody please help? {"error":"invalid_grant","error_description":"The code has expired or has been revoked."}%   Here's my request via cURL. curl -v POST "https://appleid.apple.com/auth/token" -H 'content-type: application/x-www-form-urlencoded' -d 'client_id={bundle_id}' -d 'client_secret={new JWT string}' -d 'code={authorization_code'} -d 'grant_type=authorization_code' Here are the headers and claims for generating a new JWT string. headers = { 'kid' => private_key_id (.p8), } claims = { 'iss' => team_id, 'iat' => Time.now.to_i, 'exp' => Time.now.to_i + 86400*180, 'aud' => 'https://appleid.apple.com', 'sub' => bundle_id, } For alg Im using ES256.
2
1
2k
Mar ’23
Sign In with Apple - Cannot Validate the Authorization Grant Code
I'm working on integrating Sign In with Apple into my app. The app is written in React Native using expo and I'm using this component nearly exactly for now. https://docs.expo.io/versions/latest/sdk/apple-authentication/#usage I've been able to successfully generate the Authorization Grant code with this component, however, I've been unable to validate it server side. Here is the error I'm currently getting: { "error": "invalid_grant", "error_description": "The code has expired or has been revoked." } Details I've added a Sign In with Apple key to my app and downloaded the private key. I've published the app to TestFlight so I get my own bundle identifier and not Expo's in the simulator. This is the format of the authorization grant code from the a first request (formatting not JSON as it's output from go): { realUserStatus:1 , authorizationCode:xxxx , fullName:{ middleName:null nameSuffix:null namePrefix:null givenName:null familyName:null nickname:null} state:null identityToken:xxxxxxx email:null user:xxxxx } I'm using this library to generate the verification request: https://github.com/pagnihotry/siwago I'm running a go script from my laptop (not the a domain associated with the app), as well as copying/pasting information into Postman. Both methods are using x-www-form-urlencoded. The go app is signing the client_secret, and I assume it's the correct way because I'm no longer getting a 400 invalid_client. I've decode the client_secret and confirmed that the validation request is formatted: { "alg": "ES256", "kid": "SECRET_KEY_ID" } { "iss": "TEAM_ID", "iat": 1626740200, "exp": 1629332200, "aud": "https://appleid.apple.com", "sub": "BUNDLE_ID" } I've confirmed that the client secret is signed with my private key by validating it against my private key's public complement. The form data for the authorization to https://appleid.apple.com/auth/token request is (no punctuation on values): client_id: [BUNDLE_ID] client_secret: [signed secret] code: [authorizationCode] (from the Authorization grant code) grant_type: authorization_code redirect_uri: [left empty in go, not a key in Postman] I've requested my authorization code repeatedly and thought that I might be throttled, but then I tried a brand new one the first time but still got the invalid_grant response. Looking for any help, I've spent the past two solid days on this and am exhausted.
1
1
3.3k
Mar ’23
Apple login functionality
Hi team Our app is using Apple Login and its working fine. As our focus is moving towards the enterprise customers(B2B) rather than normal cosumer, so decided to remove the Apple Login(FB, Google etc), but for the some of our customers who are already logged with Apple Login, we wanted to keep this functionality in case they want to logout and login again. So our question is this, Can we keep apple login functionality without showing the Apple login button ? Flow will be -> User will be see a login page with option to enter name and email and a continue button. As soon as user will enter the name and email and press continue, our backend will inform us that the user is old user and logged in with Apple. After getting the information we'll open the Apple Login flow without any user interaction. Please let us know in case of any confusion or doubt in explaining the question. Thanks
0
0
982
Mar ’23
Weatherkit REST API is returning 401 errors {'reason': 'NOT_ENABLED'}
I created an identifier, but did not select "Sign In with Apple" I created a key, and enabled the WeatherKit service. I have a simple python script to retrieve from the API, but I am getting "NOT ENABLED" import datetime import time # pip install requests PyJWT cryptography import jwt import requests import json from cryptography.hazmat.primitives.serialization import load_ssh_private_key from hashlib import sha1 with open("/Users/don/.ssh/AuthKey_LBV5W26ZRJ.p8", "r") as f: myKey = f.read() # matches my service id WEATHERKIT_SERVICE_ID = "net.ag6hq.sandysclock" #This is my id, redacted here WEATHERKIT_TEAM_ID = "<redacted>" # this is my private key, redacted here WEATHERKIT_KID = "<redacted>" # key ID WEATHERKIT_KEY = myKey WEATHERKIT_FULL_ID = f"{WEATHERKIT_TEAM_ID}.{WEATHERKIT_SERVICE_ID}" thisLat = 34.03139251897727 thisLon = -117.41704704143667 def fetch_weatherkit( lang="en", lat="34.031392", lon="-117.41704", country="US", timezone="US/Los_Angeles", datasets = "currentWeather,forecastDaily,forecastHourly,forecastNextHour", ): url = f"https://weatherkit.apple.com/api/v1/weather/{lang}/{lat}/{lon}?dataSets={datasets}&countryCode={country}&timezone={timezone}" now = int(time.time()) exp = now + (3600 * 24) token_payload = { "sub": WEATHERKIT_SERVICE_ID, "iss": WEATHERKIT_TEAM_ID, "exp": exp, "iat": now } token_header = { "kid": WEATHERKIT_KID, "id": WEATHERKIT_FULL_ID, "alg": "ES256", "typ": "JWT" } token = jwt.encode(token_payload, WEATHERKIT_KEY, headers=token_header, algorithm="ES256") response = requests.get(url, headers={'Authorization': f'Bearer {token}'}) return response #### End of Def myFetch=fetch_weatherkit() myStatus=myFetch.status_code myJSON=myFetch.json() print("myJSON=" + str(myJSON)) print("myStatus=" + str(myStatus)) This outputs: python weatherkit.py myJSON={'reason': 'NOT_ENABLED'} myStatus=401 I get the same results if I use the jwt.io service to create a token and use curl What am I doing wrong?
3
2
1.3k
Mar ’23
Validating Apple OAuth Token
Hi, I am currently implementing a validation on Apple OAuth token. When a user is trying to register, client-side receives tokens from Apple and sends the token when requesting a sign up. Therefore, I need to validate the OAuth token that it is an actual token from Apple. These are my questions: I've done some research and seems like that Apple does not allow me to have static client_secret which I need for token validation request. Also, I need to use the .p8 which I got when registering a app to the app store. But I'm uncertain of what I can do with the .p8 to receive the client secret. I think that I need to send the request with the token to this url https://appleid.apple.com/auth/token. Am I able to send an access token for validation? On Apple's developer document, it says that I need to send a refresh token. https://developer.apple.com/documentation/sign_in_with_apple/generate_and_validate_tokens Thank you.
0
0
1.1k
Mar ’23
Sign In With Apple on react app with firebase auth not working
Hi, I am trying to implement Sign In With Apple on a react app, using the react-apple-signin-auth package, with Firebase Authentication. My redirect URI is set to the url provided by firebase auth and client ID to the service ID created for the web app on Apple Developer. I am able to initiate the popup and input apple ID and password. However, when asked for confirmation to sign in, I get the following error: "Your request could not be completed because of an error. Please try again later" I am unsure of what is causing this error and hence unable to fix it. What should I do now?
0
0
1.5k
Feb ’23
Identify an user using apple sign inside unity on mobile and on our web app
We have an unity application using apple Sign in, and we want to build an additional web app that can also keep track of the progress of users. After people sign in using the unity app we keep track of the ID apple returns for future reference and searches. To build the webapp we created a service ID and coupled to our only appId, we then created a secret and finally we followed this guide for the setup The id_token the app outputs shows a sub that is different than the one returned in unity, even though this document here says it should be an unique identifier for our user in our app What could be going wrong? Or in case this question is better, how to properly identify an user across a mobile and web environment?
0
0
1.5k
Feb ’23
Programmatically insert RSS URL into Podcast Connect account
Hi Apple! We're developing an app for a client and would like to be able to post podcast RSS URL to Apple Podcasts/itunes programatically with the click of a button on our app. Something similar to what Anchor.fm is capeable of. I've read the documentation here: https://itunespartner.apple.com/podcasts/articles/podcast-requirements-3058 And it seems to me the RSS URL must be inserted manually into a Podcast Connect Account. Is there some kind of API that can do this? Or perhaps you could point us in the right direction. Thank you!Friendly neighborhood developer
1
0
1.7k
Feb ’23
Revoke Apple Token Api, Always retrun 400
Hello. Whenever I tried to revoke by using an access token from App, I have responsed this error message { "error": "invalid_client" }. Actually, I can't realize what the problem is. So, Please review my code and check my mistake. This is the code that generating 'client_secret' code headers = { kid: @apple_key_id, alg: "ES256" } claims = { iss: @apple_team_id, iat: Time.now.to_i, exp: Time.now.to_i + 86400*180, aud: "https://appleid.apple.com", sub: "XXXXXXXXXX" } private_key = OpenSSL::PKey::EC.new IO.read @apple_key_file_path apple_client_secret = JWT.encode(claims, private_key, "ES256", headers) auth/revoke code url = URI("https://appleid.apple.com/auth/revoke") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url.request_uri) request.body = { "client_id": "XXXXXXXXXX", "client_secret": client_secret, "token": @token, "token_type_hint": "access_token" }.to_json request.add_field("Content-Type", 'application/x-www-form-urlencoded') response = http.request(request)
0
0
1k
Feb ’23
Sign in with Apple backend flow
Hi, i'm trying to integrate the Apple Sign in function on my website. I understood how to make the front-end part using the Sign in with Apple js library and how to handle the auth response. Now the problem is: what i need to do on the server side to complete the authentication and to get the user information (name surname and email)?, the documentation isn't clear to me. Can you please explain me the server-side flow? Do you have any examples in Java? Thanks. Giacomo
0
0
1.5k
Jan ’23
Behavior when "stop using Sign in with Apple" is executed
Hi, I have a question about the behavior when "stop using Sign in with Apple" is executed. Specifically, it is about the behavior when you access the https://appleid.apple.com/account/manage page, select "Sign in with Apple", and press the button in the image below that appears when you select the Sign in with Apple linked application. Am I correct in assuming that when this button is pressed, the application developer will no longer be able to send email to the email address of the user with whom the private relay is linked? When I checked this behavior myself, I could no longer send mail, but I am not sure, so I would like to confirm this with you to be sure. Thanks, Ryo
0
0
1k
Jan ’23
App Transfer, SIWA and Transfer Identifier Availability
Hey, Our team is currently evaluating transferring an App to our parent companies team account. We have obvious concerns around SIWA and want to make sure that user accounts will persist between publishers. We have been reading the documentation here and it seems like there is a pretty well defined flow for this outlined here: https://developer.apple.com/documentation/sign_in_with_apple/transferring_your_apps_and_users_to_another_team We would like to generate transfer_identifiers for all of our users before initiating the App Transfer but we are seeing conflicting information about whether this is possible. From the docs it says: After the recipient team accepts the transfer, you have 60 days to generate transfer identifiers for the client. Which to me, can be a read a couple ways, but potentially suggests that we won't be able to generate the transfer identifiers until after initiating the transfer. We also see in this post, potentially conflicting information from an Apple rep: https://developer.apple.com/forums/thread/649251 If you plan to transfer an app from your team to another team, you can generate a transfer identifier any time. This clearly suggests that we should be able to generate transfer_identifiers at any time. To verify one way or the other, we have attempted to generate transfer_identifiers before transferring our app to the parent team. While we have successfully generated auth_tokens with the rest API, we have not been able to get a successful response back from the transfer rest api at https://appleid.apple.com/auth/usermigrationinfo So far we have only received the error: invalid_client It would be appreciated if an Apple rep (or experienced user) can weigh in on whether this should be possible. If so, any pro tips on debugging the invalid_client response would also be very much appreciated.
1
2
2.0k
Jan ’23
Download Xcode from command line
Hi everyone, I am trying to download Xcode from command line the following way: wget --certificate=certificate.pem --private-key=private-key.pem --server-response https://download.developer.apple.com/Developer_Tools/Xcode_13.3.1/Xcode_13.3.1.xip --no-check-certificate --load-cookies=cookies.txt I am getting the following error: HTTP request sent, awaiting response... 302 Moved Temporarily Location: https://developer.apple.com/unauthorized/ I have the certificate and private key from developer.apple.com and I am using them for authentication(correct me if I am wrong and they cannot be used for authentication). From several forums I found that the error regarding authorization could also be from cookies, so I got the cookies. Still the same error. I need the download of Xcode to be done from command line so that I can then automate the procedure using ansible playbooks (basically for the purpose of downloading and installing it on multiple mac machines.) Please, if the approach is entirely wrong, provide me with the right guide how to download Xcode from developer.apple.com site.
4
0
4.6k
Dec ’22
"sign in with apple" request "authorize" aways get "Invalid client" error
最近使用service id 进行 sign in with apple 网页开发,总是提示 Invalid client. 我反复多次按照文档重新建立service id 和 app id 还有 key,最终还是 Invalid client.这个问题已经超过24小时了,跟网上传说的24小时后生效应该没关系。 我删除掉了之前可以正常使用的service id,发现它现在还可以登录,所以是不是苹果的服务器缓存有问题?已经过去好几个小时了。 Recently, when using the service ID to sign in with apple web page development, the Invalid client is always prompted I have repeatedly recreated the service id, app id and key according to the document, and finally the invalid client. This problem has lasted for more than 24 hours. It should have nothing to do with the online legend that the service id, app id and key will take effect 24 hours later. I deleted the service ID that can be used normally before and found that it can still be logged in. Is there a problem with the Apple server cache? It has been several hours.
3
0
1.7k
Dec ’22
Refreshing the token when access token is expired
I was able to add apple login in my iOS App. Unfortunately, the token expires every 24 hours. I tried to follow the documentation: https://developer.apple.com/documentation/sign_in_with_apple/generate_and_validate_tokens but I get "invalid_client" error everytime.. Is there a real use case available somewhere to know which field is which? Thanks
0
0
2.8k
Nov ’22
imei verification website for apple products
Hello guys, please how can i create my imei verification website for all Apple products?
Replies
0
Boosts
0
Views
1.2k
Activity
Apr ’23
Authorization_code validation (auth/token) results invalid_grant
Hi all. In order to prepare for the new "Account deletion guidance", I have been trying to retrieve access_token and refresh_token from the authorization_code but the POST request to https://appleid.apple.com/auth/token always results invalid_grant error. https://developer.apple.com/documentation/sign_in_with_apple/generate_and_validate_tokens I've tested with fresh authorization_codes that were not expired and generated by actual devices (not simulators), but I always end up with "The code has expired or has been revoked" message. Can somebody please help? {"error":"invalid_grant","error_description":"The code has expired or has been revoked."}%   Here's my request via cURL. curl -v POST "https://appleid.apple.com/auth/token" -H 'content-type: application/x-www-form-urlencoded' -d 'client_id={bundle_id}' -d 'client_secret={new JWT string}' -d 'code={authorization_code'} -d 'grant_type=authorization_code' Here are the headers and claims for generating a new JWT string. headers = { 'kid' => private_key_id (.p8), } claims = { 'iss' => team_id, 'iat' => Time.now.to_i, 'exp' => Time.now.to_i + 86400*180, 'aud' => 'https://appleid.apple.com', 'sub' => bundle_id, } For alg Im using ES256.
Replies
2
Boosts
1
Views
2k
Activity
Mar ’23
Sign In with Apple - Cannot Validate the Authorization Grant Code
I'm working on integrating Sign In with Apple into my app. The app is written in React Native using expo and I'm using this component nearly exactly for now. https://docs.expo.io/versions/latest/sdk/apple-authentication/#usage I've been able to successfully generate the Authorization Grant code with this component, however, I've been unable to validate it server side. Here is the error I'm currently getting: { "error": "invalid_grant", "error_description": "The code has expired or has been revoked." } Details I've added a Sign In with Apple key to my app and downloaded the private key. I've published the app to TestFlight so I get my own bundle identifier and not Expo's in the simulator. This is the format of the authorization grant code from the a first request (formatting not JSON as it's output from go): { realUserStatus:1 , authorizationCode:xxxx , fullName:{ middleName:null nameSuffix:null namePrefix:null givenName:null familyName:null nickname:null} state:null identityToken:xxxxxxx email:null user:xxxxx } I'm using this library to generate the verification request: https://github.com/pagnihotry/siwago I'm running a go script from my laptop (not the a domain associated with the app), as well as copying/pasting information into Postman. Both methods are using x-www-form-urlencoded. The go app is signing the client_secret, and I assume it's the correct way because I'm no longer getting a 400 invalid_client. I've decode the client_secret and confirmed that the validation request is formatted: { "alg": "ES256", "kid": "SECRET_KEY_ID" } { "iss": "TEAM_ID", "iat": 1626740200, "exp": 1629332200, "aud": "https://appleid.apple.com", "sub": "BUNDLE_ID" } I've confirmed that the client secret is signed with my private key by validating it against my private key's public complement. The form data for the authorization to https://appleid.apple.com/auth/token request is (no punctuation on values): client_id: [BUNDLE_ID] client_secret: [signed secret] code: [authorizationCode] (from the Authorization grant code) grant_type: authorization_code redirect_uri: [left empty in go, not a key in Postman] I've requested my authorization code repeatedly and thought that I might be throttled, but then I tried a brand new one the first time but still got the invalid_grant response. Looking for any help, I've spent the past two solid days on this and am exhausted.
Replies
1
Boosts
1
Views
3.3k
Activity
Mar ’23
Apple login functionality
Hi team Our app is using Apple Login and its working fine. As our focus is moving towards the enterprise customers(B2B) rather than normal cosumer, so decided to remove the Apple Login(FB, Google etc), but for the some of our customers who are already logged with Apple Login, we wanted to keep this functionality in case they want to logout and login again. So our question is this, Can we keep apple login functionality without showing the Apple login button ? Flow will be -> User will be see a login page with option to enter name and email and a continue button. As soon as user will enter the name and email and press continue, our backend will inform us that the user is old user and logged in with Apple. After getting the information we'll open the Apple Login flow without any user interaction. Please let us know in case of any confusion or doubt in explaining the question. Thanks
Replies
0
Boosts
0
Views
982
Activity
Mar ’23
Weatherkit REST API is returning 401 errors {'reason': 'NOT_ENABLED'}
I created an identifier, but did not select "Sign In with Apple" I created a key, and enabled the WeatherKit service. I have a simple python script to retrieve from the API, but I am getting "NOT ENABLED" import datetime import time # pip install requests PyJWT cryptography import jwt import requests import json from cryptography.hazmat.primitives.serialization import load_ssh_private_key from hashlib import sha1 with open("/Users/don/.ssh/AuthKey_LBV5W26ZRJ.p8", "r") as f: myKey = f.read() # matches my service id WEATHERKIT_SERVICE_ID = "net.ag6hq.sandysclock" #This is my id, redacted here WEATHERKIT_TEAM_ID = "<redacted>" # this is my private key, redacted here WEATHERKIT_KID = "<redacted>" # key ID WEATHERKIT_KEY = myKey WEATHERKIT_FULL_ID = f"{WEATHERKIT_TEAM_ID}.{WEATHERKIT_SERVICE_ID}" thisLat = 34.03139251897727 thisLon = -117.41704704143667 def fetch_weatherkit( lang="en", lat="34.031392", lon="-117.41704", country="US", timezone="US/Los_Angeles", datasets = "currentWeather,forecastDaily,forecastHourly,forecastNextHour", ): url = f"https://weatherkit.apple.com/api/v1/weather/{lang}/{lat}/{lon}?dataSets={datasets}&countryCode={country}&timezone={timezone}" now = int(time.time()) exp = now + (3600 * 24) token_payload = { "sub": WEATHERKIT_SERVICE_ID, "iss": WEATHERKIT_TEAM_ID, "exp": exp, "iat": now } token_header = { "kid": WEATHERKIT_KID, "id": WEATHERKIT_FULL_ID, "alg": "ES256", "typ": "JWT" } token = jwt.encode(token_payload, WEATHERKIT_KEY, headers=token_header, algorithm="ES256") response = requests.get(url, headers={'Authorization': f'Bearer {token}'}) return response #### End of Def myFetch=fetch_weatherkit() myStatus=myFetch.status_code myJSON=myFetch.json() print("myJSON=" + str(myJSON)) print("myStatus=" + str(myStatus)) This outputs: python weatherkit.py myJSON={'reason': 'NOT_ENABLED'} myStatus=401 I get the same results if I use the jwt.io service to create a token and use curl What am I doing wrong?
Replies
3
Boosts
2
Views
1.3k
Activity
Mar ’23
Validating Apple OAuth Token
Hi, I am currently implementing a validation on Apple OAuth token. When a user is trying to register, client-side receives tokens from Apple and sends the token when requesting a sign up. Therefore, I need to validate the OAuth token that it is an actual token from Apple. These are my questions: I've done some research and seems like that Apple does not allow me to have static client_secret which I need for token validation request. Also, I need to use the .p8 which I got when registering a app to the app store. But I'm uncertain of what I can do with the .p8 to receive the client secret. I think that I need to send the request with the token to this url https://appleid.apple.com/auth/token. Am I able to send an access token for validation? On Apple's developer document, it says that I need to send a refresh token. https://developer.apple.com/documentation/sign_in_with_apple/generate_and_validate_tokens Thank you.
Replies
0
Boosts
0
Views
1.1k
Activity
Mar ’23
Api to upload app screenshots and metadata
Do we have any api to upload app screenshots and metadata or create experiments with Screenshots and metadata for appstore connect ?
Replies
1
Boosts
1
Views
2.3k
Activity
Mar ’23
Downloading Beta version
Im a computer developer, it seems not updates yet and ready. I am looking forwarding for more upcoming features and updates. Thank you.
Replies
1
Boosts
0
Views
891
Activity
Feb ’23
Sign In With Apple on react app with firebase auth not working
Hi, I am trying to implement Sign In With Apple on a react app, using the react-apple-signin-auth package, with Firebase Authentication. My redirect URI is set to the url provided by firebase auth and client ID to the service ID created for the web app on Apple Developer. I am able to initiate the popup and input apple ID and password. However, when asked for confirmation to sign in, I get the following error: "Your request could not be completed because of an error. Please try again later" I am unsure of what is causing this error and hence unable to fix it. What should I do now?
Replies
0
Boosts
0
Views
1.5k
Activity
Feb ’23
Identify an user using apple sign inside unity on mobile and on our web app
We have an unity application using apple Sign in, and we want to build an additional web app that can also keep track of the progress of users. After people sign in using the unity app we keep track of the ID apple returns for future reference and searches. To build the webapp we created a service ID and coupled to our only appId, we then created a secret and finally we followed this guide for the setup The id_token the app outputs shows a sub that is different than the one returned in unity, even though this document here says it should be an unique identifier for our user in our app What could be going wrong? Or in case this question is better, how to properly identify an user across a mobile and web environment?
Replies
0
Boosts
0
Views
1.5k
Activity
Feb ’23
Programmatically insert RSS URL into Podcast Connect account
Hi Apple! We're developing an app for a client and would like to be able to post podcast RSS URL to Apple Podcasts/itunes programatically with the click of a button on our app. Something similar to what Anchor.fm is capeable of. I've read the documentation here: https://itunespartner.apple.com/podcasts/articles/podcast-requirements-3058 And it seems to me the RSS URL must be inserted manually into a Podcast Connect Account. Is there some kind of API that can do this? Or perhaps you could point us in the right direction. Thank you!Friendly neighborhood developer
Replies
1
Boosts
0
Views
1.7k
Activity
Feb ’23
Revoke Apple Token Api, Always retrun 400
Hello. Whenever I tried to revoke by using an access token from App, I have responsed this error message { "error": "invalid_client" }. Actually, I can't realize what the problem is. So, Please review my code and check my mistake. This is the code that generating 'client_secret' code headers = { kid: @apple_key_id, alg: "ES256" } claims = { iss: @apple_team_id, iat: Time.now.to_i, exp: Time.now.to_i + 86400*180, aud: "https://appleid.apple.com", sub: "XXXXXXXXXX" } private_key = OpenSSL::PKey::EC.new IO.read @apple_key_file_path apple_client_secret = JWT.encode(claims, private_key, "ES256", headers) auth/revoke code url = URI("https://appleid.apple.com/auth/revoke") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url.request_uri) request.body = { "client_id": "XXXXXXXXXX", "client_secret": client_secret, "token": @token, "token_type_hint": "access_token" }.to_json request.add_field("Content-Type", 'application/x-www-form-urlencoded') response = http.request(request)
Replies
0
Boosts
0
Views
1k
Activity
Feb ’23
Sign in with Apple backend flow
Hi, i'm trying to integrate the Apple Sign in function on my website. I understood how to make the front-end part using the Sign in with Apple js library and how to handle the auth response. Now the problem is: what i need to do on the server side to complete the authentication and to get the user information (name surname and email)?, the documentation isn't clear to me. Can you please explain me the server-side flow? Do you have any examples in Java? Thanks. Giacomo
Replies
0
Boosts
0
Views
1.5k
Activity
Jan ’23
Does a request for revoking the refresh token revoke the associated access token as well?
Hello, could someone tell me: will issuing a request to revoke a refresh token revoke the associated access token as well? Seems this is usually the case with OAuth2, but just to confirm if it's the case for Apple. Thanks!
Replies
0
Boosts
0
Views
1.2k
Activity
Jan ’23
Behavior when "stop using Sign in with Apple" is executed
Hi, I have a question about the behavior when "stop using Sign in with Apple" is executed. Specifically, it is about the behavior when you access the https://appleid.apple.com/account/manage page, select "Sign in with Apple", and press the button in the image below that appears when you select the Sign in with Apple linked application. Am I correct in assuming that when this button is pressed, the application developer will no longer be able to send email to the email address of the user with whom the private relay is linked? When I checked this behavior myself, I could no longer send mail, but I am not sure, so I would like to confirm this with you to be sure. Thanks, Ryo
Replies
0
Boosts
0
Views
1k
Activity
Jan ’23
App Transfer, SIWA and Transfer Identifier Availability
Hey, Our team is currently evaluating transferring an App to our parent companies team account. We have obvious concerns around SIWA and want to make sure that user accounts will persist between publishers. We have been reading the documentation here and it seems like there is a pretty well defined flow for this outlined here: https://developer.apple.com/documentation/sign_in_with_apple/transferring_your_apps_and_users_to_another_team We would like to generate transfer_identifiers for all of our users before initiating the App Transfer but we are seeing conflicting information about whether this is possible. From the docs it says: After the recipient team accepts the transfer, you have 60 days to generate transfer identifiers for the client. Which to me, can be a read a couple ways, but potentially suggests that we won't be able to generate the transfer identifiers until after initiating the transfer. We also see in this post, potentially conflicting information from an Apple rep: https://developer.apple.com/forums/thread/649251 If you plan to transfer an app from your team to another team, you can generate a transfer identifier any time. This clearly suggests that we should be able to generate transfer_identifiers at any time. To verify one way or the other, we have attempted to generate transfer_identifiers before transferring our app to the parent team. While we have successfully generated auth_tokens with the rest API, we have not been able to get a successful response back from the transfer rest api at https://appleid.apple.com/auth/usermigrationinfo So far we have only received the error: invalid_client It would be appreciated if an Apple rep (or experienced user) can weigh in on whether this should be possible. If so, any pro tips on debugging the invalid_client response would also be very much appreciated.
Replies
1
Boosts
2
Views
2.0k
Activity
Jan ’23
Getting invalid_client on auth/authorize
I make get request to https://appleid.apple.com/auth/authorize with proper client_id and redirect_uri set up bot in dev tools and code but still getting invalid_client What may be reason?
Replies
0
Boosts
0
Views
893
Activity
Jan ’23
Download Xcode from command line
Hi everyone, I am trying to download Xcode from command line the following way: wget --certificate=certificate.pem --private-key=private-key.pem --server-response https://download.developer.apple.com/Developer_Tools/Xcode_13.3.1/Xcode_13.3.1.xip --no-check-certificate --load-cookies=cookies.txt I am getting the following error: HTTP request sent, awaiting response... 302 Moved Temporarily Location: https://developer.apple.com/unauthorized/ I have the certificate and private key from developer.apple.com and I am using them for authentication(correct me if I am wrong and they cannot be used for authentication). From several forums I found that the error regarding authorization could also be from cookies, so I got the cookies. Still the same error. I need the download of Xcode to be done from command line so that I can then automate the procedure using ansible playbooks (basically for the purpose of downloading and installing it on multiple mac machines.) Please, if the approach is entirely wrong, provide me with the right guide how to download Xcode from developer.apple.com site.
Replies
4
Boosts
0
Views
4.6k
Activity
Dec ’22
"sign in with apple" request "authorize" aways get "Invalid client" error
最近使用service id 进行 sign in with apple 网页开发,总是提示 Invalid client. 我反复多次按照文档重新建立service id 和 app id 还有 key,最终还是 Invalid client.这个问题已经超过24小时了,跟网上传说的24小时后生效应该没关系。 我删除掉了之前可以正常使用的service id,发现它现在还可以登录,所以是不是苹果的服务器缓存有问题?已经过去好几个小时了。 Recently, when using the service ID to sign in with apple web page development, the Invalid client is always prompted I have repeatedly recreated the service id, app id and key according to the document, and finally the invalid client. This problem has lasted for more than 24 hours. It should have nothing to do with the online legend that the service id, app id and key will take effect 24 hours later. I deleted the service ID that can be used normally before and found that it can still be logged in. Is there a problem with the Apple server cache? It has been several hours.
Replies
3
Boosts
0
Views
1.7k
Activity
Dec ’22
Refreshing the token when access token is expired
I was able to add apple login in my iOS App. Unfortunately, the token expires every 24 hours. I tried to follow the documentation: https://developer.apple.com/documentation/sign_in_with_apple/generate_and_validate_tokens but I get "invalid_client" error everytime.. Is there a real use case available somewhere to know which field is which? Thanks
Replies
0
Boosts
0
Views
2.8k
Activity
Nov ’22