Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sign in with Apple Auth Provider #5694

Merged
merged 2 commits into from
Jun 19, 2019
Merged

Sign in with Apple Auth Provider #5694

merged 2 commits into from
Jun 19, 2019

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented Jun 19, 2019

Closes: #5632

Should work out of the box for linking users.

{
  "apple-signin": {
    "id_token": "jwt token for user", // required, used for validation
    "access_token": "an authorized access token for the user", // optional, currently does nothing but maybe in the future
  }
}

There is an optional client_id that you can pass in to Server Auth Configuration for extra validation.

{
  auth: {
   apple-signin: {
     client_id: "", // optional, use the Service ID from apple.
  }
}

There is a guide and code for setting getting your id_token https://developer.okta.com/blog/2019/06/04/what-the-heck-is-sign-in-with-apple

Apple's documentation is incomplete and incorrect in places
https://developer.apple.com/sign-in-with-apple/get-started/

Shoutout to @Techofficer for doing most of the heaving lifting.
https://github.com/Techofficer/node-apple-signin

@codecov
Copy link

codecov bot commented Jun 19, 2019

Codecov Report

Merging #5694 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5694      +/-   ##
==========================================
+ Coverage   94.17%   94.19%   +0.01%     
==========================================
  Files         129      130       +1     
  Lines        9240     9264      +24     
==========================================
+ Hits         8702     8726      +24     
  Misses        538      538
Impacted Files Coverage Δ
src/Adapters/Auth/apple-signin.js 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 947c6be...ca18288. Read the comment docs.

@dplewis dplewis requested a review from acinader June 19, 2019 20:49
Copy link
Contributor

@acinader acinader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suweet!

@dplewis dplewis merged commit fcdf2d7 into master Jun 19, 2019
@dplewis dplewis deleted the apple-signin branch June 19, 2019 21:05
@TomWFox
Copy link
Contributor

TomWFox commented Jun 19, 2019

@dplewis Thanks a lot for taking the lead on this, I’ve spent the past couple hours setting it up in my app so I’m looking forward to testing this out!

@dplewis
Copy link
Member Author

dplewis commented Jun 19, 2019

@TomWFox I post links above for configuration. Let me know if it works

@leapingcoyote
Copy link

leapingcoyote commented Jun 27, 2019

We are getting this message, any idea what are we missing? Do you have some step by step setup and usage instructions. I feel we are missing a step. @TomWFox did it work for you?

{
    "message": "This authentication method is unsupported.",
    "code": 252
}

We have setup and api request from a server using this

    const user = new parse.User();
    return user._linkWith("apple-signin",
        {
            authData: authData
        }
    );

On our parse server config we are using this:

auth: {
    "apple-signin": {
      "client_id": "com.ourclient"
    }
  },

@dplewis
Copy link
Member Author

dplewis commented Jun 27, 2019

@leapingcoyote This isn’t released yet, are you using the master branch to test?

@leapingcoyote
Copy link

@dplewis yes we are using the master branch to test

@dplewis
Copy link
Member Author

dplewis commented Jun 27, 2019

Thanks for reporting. I’ll look into it

@dplewis
Copy link
Member Author

dplewis commented Jul 3, 2019

@leapingcoyote I published a fix for this #5755

@tealshift
Copy link

@dplewis Hi, I'd like to ask about this update you added here. Is this update necessary for Apple Sign-In to work for an iOS client and save authData to MongoDB, or will we be okay using an older version of Parse Server?

@dplewis
Copy link
Member Author

dplewis commented Sep 27, 2019

@tealshift You have to update to the latest version. If you don’t want to update. You can copy this and create your own module.

UnderratedDev pushed a commit to UnderratedDev/parse-server that referenced this pull request Mar 21, 2020
* Sign in with Apple Auth Provider

Closes: parse-community#5632

Should work out of the box.

* remove required options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sign in with Apple Authentication
5 participants