Templates Plugins Courses

🍏 Sign in with Apple - New Plugin from Zeroqode

If you submit an app to App Store and it has user authentication Apple Review Team will require Apple Signing to be implemented as one of the sign in options. So this plugin is a must have if you want to publish your app on App Store.

Moreover Sign in with Apple makes it easy for users to sign in to your apps and websites using their Apple ID. Instead of filling out forms, verifying email addresses, and choosing new passwords, they can use Sign in with Apple to set up an account and start using your app right away.

Prerequisites
You must have a developer account with Apple to interact with the plugin. Create you development account at: https://developer.apple.com/sign-in-with-apple/get-started/

For details, screenshots and demos please visit the plugin page at: https://zeroqode.com/plugin/sign-in-with-apple-1575475552052x418799001167781100

Please support us with a retweet

Levon Terteryan

Founder @ Zeroqode

zeroqode-for-web-160x120

Bubble Templates

Zeroqode Blocks

Bubble Plugins

Bubble Courses

Convert Web to iOS & Android

No-code Development Services

Hi there,

I could use some help implement this plugin on Bubble. I’m getting stuck on the redirect uri. I’m following the steps from here: https://docs.zeroqode.com/plugins/sign-in-with-apple-plugin

I have the sign in element on the page, with redirect uri:
https://speakeasycommunity.bubbleapps.io/version-test/api/1.1/wf/applesignin/initialize

I understand that once I am able to do the initialization, I remove “/initialize” (and assume I also remove version-test when using in live)

I grabbed this redirect uri from here, and clicking detect data.

Then I leave this open while trying to click the link (not sure if this matters)

But I just get to this page:

Plugin configured here:

Let me know if you have any suggestions to get it working. Thanks!

Ken

Hello @speakeasycommunity

Could recommend you double check the documentation as well the demo page setup:


Try recreate all the steps from workflow/backend workflow as demonstrated , should help you with it.
:pray:

Thanks for understanding.

Regards,
Dumitru.

Hi @Dumitru,

Thanks for the suggestion. I’ve gone through the demo page and the documentation and cannot find the problem. Do you have any suggestions on what might be going wrong based on the screenshots I posted?

Cheers,
Ken

Hello @speakeasycommunity

Sorry for delayed response :pray:
You could try create new application in the Apple Developer account , get new keys and create from new by linking the Bubble Application with the new app.
Follow the setup and give it a try!

Currently it looks like the redirect uri is invalid, because you’re maybe using the wrong ID
Please check this thread:
https://forums.developer.apple.com/thread/122536#381571
Hope this helps.

Regards

Hi @Dumitru

I’ve made some progress after spending a lot of time on this. Three follow up questions:

  1. Now I am able to authenticate the user on Apple, and the sign up event is working correctly, but the log in event is not working. I see that in the demo the user is correctly logged in, but I cannot identify any difference that would cause signup to work but login not to work.

  2. The Apple user’s name is not being passed through Sign in with Apple. It looks like with the version on the demo also is not correctly capturing the user’s name, even though it is supposed to in the field Gname. Is this a bug?

  3. Is there any way to pass information in the URL when clicking on the Sign in with Apple button? I have some user information already stored in their temp Current User cookie, but I don’t have the user information yet, and when the user goes to the Apple log in, their Current User cookie seems to be deleted (this also was not an issue with the Google and Facebook log in plugins). Alternatively, is there a way to make the sign in with apple a workflow event, so that I can at least do some actions before triggering the sign in with Apple?

Thanks for your help. This has been a real headache so I appreciate any assistance you can give. I need this plugin to work to be able to submit my app to the Apple App Store, and if it doesn’t work with Zeroqode I’ll have to dig into other ways to implement.

Ken


For any other folks who find this thread, a couple steps I took to make progress:

  1. Make sure you are using the services ID, not the general app ID (from the zeroqode documentation)
  2. Make sure to add all the URLs to services at Apple Developer Console --> Services ID --> Sign in with apple --> Configure --> Return URLs (for example I added myapps.bubbleapps.io/api/1.1/wf/applesignin and also the same + /initialize and also these two with version-test included)
    (I referenced this article to help me figure out step 2 https://medium.com/identity-beyond-borders/how-to-configure-sign-in-with-apple-77c61e336003)

Hello Ken @speakeasycommunity

  1. Can you provide more details in order to help you better? Like workflow setup, screenshots, error, steps to reproduce the issue.

  2. It should capture without a problem, though I believe if you’ve check to sign in as private mail - when Apple will not return the id or name, but an encoded mail string only.
    For the demo seems like, there is a condition in place which writes the name in respective field when the first item is empty.


    However in the database the first item is already filled in with data, so the workflow does not write in that cell anything since condition is not met.

  3. Unfortunately, no. It is not possible to pass any parameters through URL .

Thanks for understanding.

Regards,
Dumitru.

Thanks for getting back to me @Dumitru.

As noted, this sign in is working correctly:

But this log in does not work, despite using exactly the same values.

So the user is then signed up but cannot log in with the Apple sign up button.

Note that I added an MD5 hash encryption to make the password a bit more secure. This also allows me to use a workaround to log the user in based on their email and the md5 hash of the Apple user ID stored elsewhere, instead of using the Apple sign up button, given that the log the user in function isn’t working for some reason here. I tried without the MD5 hash and the log in action still did not function in the API workflow.

  1. I don’t think that Gname step functions - if you check the app data in the demo, the Gname field is always empty (or, perhaps as read only, I don’t have permission to view it?)

  2. Understood, I have a workaround based on IP address that is not ideal but is able to preserve user data from before signing in with apple to after.

Thanks @speakeasycommunity

We’ll check the login action , if possible can you add [email protected] as collaborator and provide the name of the page and application so we could check debug this?
Thanks for understanding.
:pray:

Hello @speakeasycommunity

Sorry for delay, we’ve looked through plugin and both Signup and Login work correctly.
The workflow should no have an hashing method encryption though , since this it how it the response come from Apple.

As for the Name state, seems like an issue on Apple’s side and we can not retrieve it by making the call.
We’re working on the issue here, however it may take some time.
Sorry for inconvenience and thanks for understanding :pray:

Regards,
Dumitru.

Hi,

thank you for creating the Apple SignIn Plugin, so far so good, but
i cant get data from apple, maybe I need an Apple Machine, a Mac as device, with a valid apple ID?
Can you check this out please, see the video, I think you have already rights to check in-app (secondra.com)
https://www.loom.com/share/b155b4cc644d45378c612b3c1ef749af


Thank you, Alex

Hello, @meinharttv. Thanks for reaching out.

Yes, for using this plugin you need to have a valid Apple ID and the Apple developer account.


Would you kindly check the plugin documentation to make sure you have set everything right:
https://docs.zeroqode.com/plugins/sign-in-with-apple-plugin

Hope this helps :pray:
Regards,

Hello @speakeasycommunity

We’ve pushed an update to plugin, for retrieving a Name state with a fix. Please upgrade to latest version of plugin, refresh the application and give it a try.
:pray:
Thank you for your patience.

Regards

When detecting on the endpoint initialization, my data received does not have a user element causing me to get a 400:

I am using the latest version of the plugin, but it appears the demo app (which works and does retrieve the user data) is using a testing version?

Please help.

The raw data is as follows:
{
“state”: “EN”,
“code”: “c4e2ee9636aad4579853b35f2e8f4b462.0.nrsqt.xr22sFEcY7K6SdwQWYxofg”,
“id_token”: “eyJraWQiOiJlWGF1bm1MIiwiYWxnIjoiUlMyNTYifQ.eyJpc3MiOiJodHRwczovL2FwcGxlaWQuYXBwbGUuY29tIiwiYXVkIjoiaW8ucGV0bWluZGVyLmFscGhhIiwiZXhwIjoxNTkzNDA1OTcxLCJpYXQiOjE1OTM0MDUzNzEsInN1YiI6IjAwMTIwMy5kYTQxODdjYjMxY2Q0YTljOTMyNTY5MmI1ZmNkMDM5YS4wMzQ5IiwiY19oYXNoIjoiVTRXVkZlTjlHYUhtQmJUWHpzUTNVZyIsImVtYWlsIjoiZWR3YXJkLmJ1Y2hob2x6QGdtYWlsLmNvbSIsImVtYWlsX3ZlcmlmaWVkIjoidHJ1ZSIsImF1dGhfdGltZSI6MTU5MzQwNTM3MSwibm9uY2Vfc3VwcG9ydGVkIjp0cnVlfQ.KXvEGmTozzrwOAtEMZ454pjd7ApDTpbfwS2gOt5ePDcVfcrrCGG9rEuBmPQw_W_Big9YUv7Cb78Zhtl_yUb8RyNx1iDZzRpvMaDVFv6Vok20wFlzpZOjolnWXApSri8YC5h15U-CmwOUw7S0bZeYY_NuD31qecjRlunLBYpI3b7RJOZ2xM4hxYImp4uUt7sZWelSNcRZ8Cg-ZGu3AxkU3Ppx5HgCv0EgdSMyWWodgekPvurwQy0uS4gRQ0uH9pCu2n8An_1n6z5tH5kE5DzUp_Egn7PAWN8mtK7TXDVwod4pJidO3EK9ICeESNlSHldn_Wh3NUNrBCHaLxU3-vnBag”
}

Log from the workflow:
Workflow error - Plugin action Apple SignIn - Authorize User error: Error: error:0909006C:PEM routines:get_name:no start line at Sign.sign (internal/crypto/sig.js:105:29) at sign (/var/task/node_modules/jwa/index.js:152:45) at Object.sign (/var/task/node_modules/jwa/index.js:200:27) at Object.jwsSign [as sign] (/var/task/node_modules/jws/lib/sign-stream.js:32:24) at Object.module.exports [as sign] (/var/task/node_modules/jsonwebtoken/sign.js:204:16) at getClientSecret (eval at build_function (/var/task/index.js:55:21), <anonymous>:29:27) at eval (eval at build_function (/var/task/index.js:55:21), <anonymous>:53:32) at Object.async_fn [as async] (/var/task/index.js:242:13) at eval (eval at build_function (/var/task/index.js:55:21), <anonymous>:51:20) at /var/task/index.js:278:23

Hello, @edward.buchholz.
Thanks for reaching out.

I hope you have followed the instructions, provided in the plugin documentation :pray:
Would you kindly re-check the plugin documentation (the setup guide) to make sure you’ve done everything correctly:
https://docs.zeroqode.com/plugins/sign-in-with-apple-plugin#plugin-api-workflow

  1. The user parameter should appear within the API Workflow Request data once you add the Apple SignIn - Authorize User:
  2. The Apple SignIn - Authorize User action settings should contain User Data: Request Data’s user field:

Bubble Manuals - Using APIs:
https://manual.bubble.io/building-plugins/adding-api-connections#oauth2-user-agent-flow
https://manual.bubble.io/using-the-bubble-api/how-to-use-the-api#automatic-detection
Dev.Apple info:
https://developer.apple.com/sign-in-with-apple/get-started/
https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_js/configuring_your_webpage_for_sign_in_with_apple

I hope it helps.
Regards,

Thanks @kate - I have now corrected the key issues and am receiving the following error in log:
Workflow error - Plugin action Apple SignIn - Authorize User error: Error: Request failed with status code 400 at createError (/var/task/node_modules/axios/lib/core/createError.js:16:15)

I’ve poured over the demo app and docs and am not doing anything differently… please help!

@edward.buchholz,

An HTTP 400 Bad Request error indicates one of the following:

  • Unsupported OAuth parameters
  • Unsupported signature method
  • Missing required authorization parameter
  • Duplicated OAuth protocol parameter

https://developer.apple.com/documentation/devicemanagement/device_assignment/authenticating_with_a_device_enrollment_program_dep_server/interpreting_error_codes

I presume the issue might be concerned with your OAuth key.
Please take a look at this tutorial, it might be helpful:

I hope this will be helpful :pray:
Regards,

Agreed. That’s probably it… but do I have any control over that with this plugin?

@edward.buchholz,

I’m afraid, you need to re-check your plugin settings from the very beginning. Stick to the plugin documentation guide - pay your attention to the How to set up plugin keys section.
And check the Apple Guidelines:
https://developer.apple.com/sign-in-with-apple/get-started/

I can not reproduce your case - the plugin demo page is working without any alike issue.

I hope if you try to redo the plugin setup with the attention to the Setting up Keys in Plugin Settings sections - this will be helpful :pray:
Regards,