Sign in with Apple JS

RSS for tag

Provide users with a fast, secure way to sign into your web service with their Apple ID using Sign in with Apple JS.

Posts under Sign in with Apple JS tag

128 Posts

Post

Replies

Boosts

Views

Activity

"Hide Email" option not show in form
First, sign in with apple, I saw 2 options, first is Share email, it's original email, second is Hide email, it's an email generated by Apple. I choose option 2, and I go to iCloud setting in iPhone settings > Click on ID Apple, iCloud+ ... (first option) > iCloud > Hide My Email > Choose the email that are using > Deactivate email address and delete that email. I go to sign in with apple again, it does not show the option Hide email. How to enable this option again?
1
0
1.4k
Dec ’21
Getting {"isTrusted":false} when trying sign in with apple JS
I have this js code: document.addEventListener('AppleIDSignInOnSuccess', (data) = {     //handle successful response     console.log(data["detail"].authorization.id_token)     response = parseJwt(data["detail"].authorization.id_token)     email = response["email"]     console.log(email)     loginWithEmail(email) //    console.log("APPLE SIGN IN SUCCESSFFUL"); }); //Listen for AppleId authorization failures document.addEventListener('AppleIDSignInOnFailure', (error) = {     //handle error.     alert(JSON.stringify(error))     console.log("APPLE SIGN IN UNSUCCESSFFUL"); }); And it just stopped working. Now every time I sign in I get "APPLE SIGN IN UNSUCCESSFFUL" and the error is {"isTrusted":false}. What are ways around this?
3
0
3.1k
Dec ’21
Missing user data in authorization response when using Sign in with Apple JS.
I am following the instructions here https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_js/configuring_your_webpage_for_sign_in_with_apple Unfortunately I am not able to receive user data A JSON string containing the data requested in the scope property. The returned data is in the following format: { "name": { "firstName": string, "lastName": string }, "email": string } when usePopup is set to true. I defined scopes as described in documentation Use space separation when requesting multiple scopes; for example, "scope=name email". User data is returned correctly when usePopup is set to false but then every time we have to enter AppleId which was the reason why our app was rejected by the Apple reviewer. After research I have found that the problem is with response_mode, it needs to be set to form_post rather than web_message what is also described here -> https://developer.apple.com/forums/thread/118209 We only support response_mode "form_post". we will make form_post as default and remove redirect. In the meantime please add &response_mode =form_post in the request by Natthakorn123. There is no way to define response_mode=form_post in AppleID.auth.init while usePopup is true because it is automatically overwritten by embedded Sign in with Apple JS to web_message. t=e.usePopup?t+"&response_mode="+encodeURIComponent("web_message"):t+"&response_mode="+encodeURIComponent(e.responseMode) How to fetch additional user data in authorization response using embedded Sign in with Apple JS while usePopup is true ?
0
0
1.5k
Dec ’21
Apple sign-in troubles with use case
Hello, I'm currently struggling to figure out how I can make Apple sign in work with my app configuration. Maybe I'm just dumb, but I really can't figure out what I need to do to make it work. So I have a Next.js app setup server-side rendering my React frontend, and on a separate server, I have a Node.js (specifically Adonis.js) backend/api which I use to handle auth and sessions. I have both Facebook and Google OAuth2 logins setup and working perfectly, where I'm receiving a code as a query param in my callback url to my frontend, which the client then sends that code to my backend/api, which uses that code with the provider (FB or Google) to get their email, name, and any other data I could use to prevent the user from having to add later, and either create the user and log them in, or just log them in if they already exist using cookies. I don't need any sort of write access to their third party account, or anything more than reading their name and email so they don't have to enter it themselves, and so they don't have to enter a password on my site. There are 2 different questions I have. (and if there is a solution to the first one, it would make my life so much easier ha..) If I use these query params similar to how I would with Google or Facebook: response_type: 'code', client_id: Env.get('APPLE_APP_ID'), redirect_uri: 'https://example.com/auth/apple/callback' state: '', scope: '', response_mode: 'query' And I get redirected back to my frontend with the code in the url params, and I send it to my API like I do with Facebook/Google, is there any endpoint with Apple's system that I can use that code to request the user's email and name from? 2. From reading through doc after doc, and it still being fuzzy, I'm thinking I may need to use the form_post response mode kind of like this?: response_type: 'code id_token', client_id: Env.get('APPLE_APP_ID'), redirect_uri: 'https://example.com/auth/apple/callback', state: '', scope: ['email', 'name'].join(' '), response_mode: 'form_post' My impression is that it would post a token, and the user data to my callback url, and that I can get the user's email and name from the user's first request and attach the token received to the user in my database. I just do not for the life of me understand how I could use this pattern with how my app is setup. Would I have to have a post handler and a page setup on the same route (I don't even know if Next.js allows something like that), and then from that, I send that data to my backend server and create the account with the data received? Even if all that worked, I don't think I would be able to set the user's session since I rely on the request being made from my frontend to my backend utilizing the set-cookie header. Please let me know your thoughts, input, or clarifications. Thanks, Brody
2
0
3.4k
Nov ’21
Invalid_uri , configuring Webpage for apple sign in
Hi below is my code , I am getting invalid uri , I really need this to work , can someone please help ? I went through all the articles nothing worked Under the Service ID configuration domain : api.oro.art return URL : https://api.oro.art:3000 let init = function(){ console.log("APP START FOR APPLE"); window.AppleID.auth.init({ clientId : 'art.oro.services', scope : 'name email', redirectURI : 'https://api.oro.art:3000', state : 'openssl_random_pseudo_bytes', usePopup: true }); console.log("Got to the end"); }
0
0
581
Oct ’21
"Hide Email" option not show in form
First, sign in with apple, I saw 2 options, first is Share email, it's original email, second is Hide email, it's an email generated by Apple. I choose option 2, and I go to iCloud setting in iPhone settings > Click on ID Apple, iCloud+ ... (first option) > iCloud > Hide My Email > Choose the email that are using > Deactivate email address and delete that email. I go to sign in with apple again, it does not show the option Hide email. How to enable this option again?
Replies
1
Boosts
0
Views
1.4k
Activity
Dec ’21
Getting {"isTrusted":false} when trying sign in with apple JS
I have this js code: document.addEventListener('AppleIDSignInOnSuccess', (data) = {     //handle successful response     console.log(data["detail"].authorization.id_token)     response = parseJwt(data["detail"].authorization.id_token)     email = response["email"]     console.log(email)     loginWithEmail(email) //    console.log("APPLE SIGN IN SUCCESSFFUL"); }); //Listen for AppleId authorization failures document.addEventListener('AppleIDSignInOnFailure', (error) = {     //handle error.     alert(JSON.stringify(error))     console.log("APPLE SIGN IN UNSUCCESSFFUL"); }); And it just stopped working. Now every time I sign in I get "APPLE SIGN IN UNSUCCESSFFUL" and the error is {"isTrusted":false}. What are ways around this?
Replies
3
Boosts
0
Views
3.1k
Activity
Dec ’21
Missing user data in authorization response when using Sign in with Apple JS.
I am following the instructions here https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_js/configuring_your_webpage_for_sign_in_with_apple Unfortunately I am not able to receive user data A JSON string containing the data requested in the scope property. The returned data is in the following format: { "name": { "firstName": string, "lastName": string }, "email": string } when usePopup is set to true. I defined scopes as described in documentation Use space separation when requesting multiple scopes; for example, "scope=name email". User data is returned correctly when usePopup is set to false but then every time we have to enter AppleId which was the reason why our app was rejected by the Apple reviewer. After research I have found that the problem is with response_mode, it needs to be set to form_post rather than web_message what is also described here -> https://developer.apple.com/forums/thread/118209 We only support response_mode "form_post". we will make form_post as default and remove redirect. In the meantime please add &response_mode =form_post in the request by Natthakorn123. There is no way to define response_mode=form_post in AppleID.auth.init while usePopup is true because it is automatically overwritten by embedded Sign in with Apple JS to web_message. t=e.usePopup?t+"&response_mode="+encodeURIComponent("web_message"):t+"&response_mode="+encodeURIComponent(e.responseMode) How to fetch additional user data in authorization response using embedded Sign in with Apple JS while usePopup is true ?
Replies
0
Boosts
0
Views
1.5k
Activity
Dec ’21
Response with just the code on redirect at apple signin
I implemented a apple signin on reactjs using the lib react-apple-login, the authentication is working with no problems, but on redirect to my API I only receive the code, none of the other data came on request
Replies
1
Boosts
0
Views
1.5k
Activity
Nov ’21
Apple sign-in troubles with use case
Hello, I'm currently struggling to figure out how I can make Apple sign in work with my app configuration. Maybe I'm just dumb, but I really can't figure out what I need to do to make it work. So I have a Next.js app setup server-side rendering my React frontend, and on a separate server, I have a Node.js (specifically Adonis.js) backend/api which I use to handle auth and sessions. I have both Facebook and Google OAuth2 logins setup and working perfectly, where I'm receiving a code as a query param in my callback url to my frontend, which the client then sends that code to my backend/api, which uses that code with the provider (FB or Google) to get their email, name, and any other data I could use to prevent the user from having to add later, and either create the user and log them in, or just log them in if they already exist using cookies. I don't need any sort of write access to their third party account, or anything more than reading their name and email so they don't have to enter it themselves, and so they don't have to enter a password on my site. There are 2 different questions I have. (and if there is a solution to the first one, it would make my life so much easier ha..) If I use these query params similar to how I would with Google or Facebook: response_type: 'code', client_id: Env.get('APPLE_APP_ID'), redirect_uri: 'https://example.com/auth/apple/callback' state: '', scope: '', response_mode: 'query' And I get redirected back to my frontend with the code in the url params, and I send it to my API like I do with Facebook/Google, is there any endpoint with Apple's system that I can use that code to request the user's email and name from? 2. From reading through doc after doc, and it still being fuzzy, I'm thinking I may need to use the form_post response mode kind of like this?: response_type: 'code id_token', client_id: Env.get('APPLE_APP_ID'), redirect_uri: 'https://example.com/auth/apple/callback', state: '', scope: ['email', 'name'].join(' '), response_mode: 'form_post' My impression is that it would post a token, and the user data to my callback url, and that I can get the user's email and name from the user's first request and attach the token received to the user in my database. I just do not for the life of me understand how I could use this pattern with how my app is setup. Would I have to have a post handler and a page setup on the same route (I don't even know if Next.js allows something like that), and then from that, I send that data to my backend server and create the account with the data received? Even if all that worked, I don't think I would be able to set the user's session since I rely on the request being made from my frontend to my backend utilizing the set-cookie header. Please let me know your thoughts, input, or clarifications. Thanks, Brody
Replies
2
Boosts
0
Views
3.4k
Activity
Nov ’21
Invalid_uri , configuring Webpage for apple sign in
Hi below is my code , I am getting invalid uri , I really need this to work , can someone please help ? I went through all the articles nothing worked Under the Service ID configuration domain : api.oro.art return URL : https://api.oro.art:3000 let init = function(){ console.log("APP START FOR APPLE"); window.AppleID.auth.init({ clientId : 'art.oro.services', scope : 'name email', redirectURI : 'https://api.oro.art:3000', state : 'openssl_random_pseudo_bytes', usePopup: true }); console.log("Got to the end"); }
Replies
0
Boosts
0
Views
581
Activity
Oct ’21
Clarification: How can I support the "Sign in with Apple" in below 12 iOS versions
I need to know how can I support the Sign in with apple in lower versions. Shall I need to create any web and then set this in app's button to launch the web in side the app? What are the easiest way to make this as working condition. Note: We have backened support to make this as workable one.
Replies
0
Boosts
0
Views
649
Activity
Oct ’21
AppleJS & MusicKit JS
Is it possible to exchange applejs authentication code for a music user token? Basically - Is it possible to use apple signin with music kit without users needing to sign in twice to apple?
Replies
1
Boosts
0
Views
1.4k
Activity
Oct ’21