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

Using Apple Sign-On with PFLoginViewController #1493

Closed
brabe79 opened this issue Apr 4, 2020 · 16 comments · Fixed by #1783
Closed

Using Apple Sign-On with PFLoginViewController #1493

brabe79 opened this issue Apr 4, 2020 · 16 comments · Fixed by #1783
Labels
type:feature New feature or improvement of existing feature

Comments

@brabe79
Copy link

brabe79 commented Apr 4, 2020

Has anyone successfully added the apple sign on button with PFLoginViewController? My app is getting rejected because I don't have Apple Signon and I'vey built everything with PFLoginViewController. Just curious if anyone has any examples. Thanks!

@dbergman
Copy link

dbergman commented Apr 7, 2020

I am also looking for a solution for this.

@drdaz
Copy link
Member

drdaz commented Apr 7, 2020

Unfortunately the current solution is to make your own login view controller and implement it there.

I was working on a branch that added the Sign In With Apple button to PFLoginViewController, but I won't merge it (nor can we release a version including it) until the issues with our master branch are fixed.

@noobs2ninjas noobs2ninjas added Good First Task type:feature New feature or improvement of existing feature labels Apr 13, 2020
@UnderratedDev

This comment has been minimized.

@noobs2ninjas
Copy link
Member

@UnderratedDev That would be amazing! We actually are trying to get bolts and dependencies updated to work with iOS 13/Catalyst submissions and had to put off our AppleSignIn api off for the mean time. However, thats definitely our biggest request right now. So, any help would be amazing.

@drdaz
Copy link
Member

drdaz commented Apr 16, 2020

I can take a look at this. In reference to this: Parse Server Pull Request. I made the backend changes for Apple Sign In for Parse Server & have implemented my own Apple Sign In with Parse. I can do some cleanup & perhaps release a utils file, & take a look at the PFLoginController also while I'm doing that.

I've done most of the implementation for Parse's architecture in the branch here called Apple_Sign_In. Take a look if you want.

Since starting it there were significant changes to the project files in master. So there needs to be either a serious merge, or a manual move of the new code content into a more recent branch. The latter option is probably less painful.

@UnderratedDev
Copy link

@drdaz Thanks man, I appreciate it, I'll definitely check that out. I did a base implementation of the provider a while ago but it needs a lot of work, so I will mostly likely use yours as a start point or for reference! :)

@noobs2ninjas
Copy link
Member

@UnderratedDev We've been talking about a big ParseUI update for 1.18.1 for a while. We're wanting to get them all updated so developers can use the newer features that comes with iPad OS and Catalyst. Or at the minimum just get them usable in catalyst in general Definitely a discussion for later, just something to keep in mind as you look through everything. Ideally though, we'd love to go through making sure that the login view and authentication works great in Slide Over and works seamlessly with split/multi-window setups. Not that you have to do all that, just thought it might be something to think about as you go through everything.

@drdaz
Copy link
Member

drdaz commented Apr 16, 2020

I have every intention of getting my Apple Sign In code finished and merged fwiw (I spent a lot of time on it). It just made no sense to work on it while master was broken.

@noobs2ninjas
Copy link
Member

Thats true @drdaz. Do you think the code is large enough to warrant its own submodule like Twitter and FacebookUtils?

@drdaz
Copy link
Member

drdaz commented Apr 16, 2020

Apple Sign In? I don't think so. The FB and Twitter Utils projects act as facades. The Apple Sign In implementation is much simpler than the FB and Twitter logins since the logic is baked into the OS. I don't feel like it's necessary to wrap it to the same extent.

@isaacAssaban
Copy link

Unfortunately the current solution is to make your own login view controller and implement it there.

Hey @drdaz would you mind sharing your apple sign in implementation in custom vc with parse ?. I have got the apple sign in flow working but I dont really know how i should create my own user with data retrieved from apple credentials.
Calling PFUser.logInWithAuthType(inBackground: "apple", authData: ["token":tokenString, "id": user]) provkes an internal server error coming from parse.
Optional("{"code":1,"message":"Internal server error."}")

Would be greatly appreciated, thx

@brianyyz
Copy link

@drdaz would also like to see your implementation if you can share.

@drdaz
Copy link
Member

drdaz commented Apr 16, 2020

Alright. Full disclaimer; I don't know the exact state of this. It's been months since I looked at it. But here https://github.com/parse-community/Parse-SDK-iOS-OSX/tree/Apple_Sign_In

If you're just trying to understand and implement Apple Sign In (not using ParseUI), this might not be the ideal base to look at; there's going to be some misdirection going on due to Parse's architecture.

@drdaz
Copy link
Member

drdaz commented Apr 16, 2020

Oh I just realised that's not what you're asking for... ahh. I can't share my own (non ParseUI) implementation right now. But it was based on Back4App's sample code: https://www.back4app.com/docs/ios/sign-in-with-apple-ios

@brianyyz
Copy link

Thanks for the pointer!

@isaacAssaban
Copy link

isaacAssaban commented Apr 16, 2020

thanks for the quick reply @drdaz

Yeah I have been using the back4app sample code + configuration from the tutorial but whatever I do, I end up receiving the same message from Parse. Optional("{"code":1,"message":"Internal server error."}")

I just downloaded the sample again, created an appId and added it in parse Apple Settings, created a service id, and a key.
I have also enabled the apple sign in my service id, and configured the web auth configuration by adding "APP_NAME".back4app.com as the domain URL and https://"APP_NAME".back4app.com/redirect as the redirect URL.

Finally i have added the appId (bundle id) in Parse Apple Settings, and modified the appdelegate with my appId and clientKey
However once i run the sample project and sign with apple, parse returns an internal server error upon loginWithAuth call.

I noticed during the web auth configuration in the service ID there was no apple-developer-domain-association.txt file to download anymore. Might it be related to this, am I missing something ? Any help would be greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or improvement of existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants