# ParseSwift login examples for Apple, Facebook, & Google login

**URL:** <https://community.parseplatform.org/t/parseswift-login-examples-for-apple-facebook-google-login/2481>\
**Category:** ParseSwift SDK\
**Created:** [March 8, 2022, 2:49am UTC](https://community.parseplatform.org/t/parseswift-login-examples-for-apple-facebook-google-login/2481 "2022-03-08T02:49:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jem5519](https://community.parseplatform.org/user_avatar/community.parseplatform.org/jem5519/32/1091_2.png) [@jem5519](https://community.parseplatform.org/u/jem5519)\
**Post date:** [March 8, 2022, 2:49am UTC](https://community.parseplatform.org/t/parseswift-login-examples-for-apple-facebook-google-login/2481/1 "2022-03-08T02:49:00Z")

</div>

I am looking for sample code for Apple, Facebook, & Google logins with ParseSwift. I have the Parse iOS SDK samples but they don’t carry over to ParseSwift. I have looked at the playground examples but they don’t cover this question from what I can see.

---

<div class="post-metadata">

**Author:** ![cbaker6](https://community.parseplatform.org/user_avatar/community.parseplatform.org/cbaker6/32/114_2.png) [@cbaker6](https://community.parseplatform.org/u/cbaker6)\
**Post date:** [March 8, 2022, 12:42pm UTC](https://community.parseplatform.org/t/parseswift-login-examples-for-apple-facebook-google-login/2481/2 "2022-03-08T12:42:01Z")

</div>

In your client application:

1. Add the dependency (if any) of the respective 3rd party framework you want to login with
2. Follow the respective SDK directions and examples for logging in
3. When completing step 2, you will receive tokens/credentials from the respective SDK, pass them to ParseSwift using the matching method from the [API documentation](http://parseplatform.org/Parse-Swift/api/Structs/ParseApple.html). If you don’t see a type for the 3rd party authentication you want to use, look in the **Alternatives/Workarounds** section [here](https://github.com/parse-community/Parse-Swift/issues/55). An example of Apple login is below:

> <https://github.com/netreconlab/SnapCat/blob/1068fa766a6c6f63ee9326af51fba5ee4fb62d7c/SnapCat/Onboarding/OnboardingViewModel.swift#L134-L190>

On the server-side, you may need to ensure your server is [configured](https://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication) correctly.

If you would like to add tutorials for logging in or any others, see [here](https://github.com/parse-community/Parse-Swift/issues/325) for how to add them to the SDK.

---

<div class="post-metadata">

**Author:** ![jem5519](https://community.parseplatform.org/user_avatar/community.parseplatform.org/jem5519/32/1091_2.png) [@jem5519](https://community.parseplatform.org/u/jem5519)\
**Post date:** [March 9, 2022, 5:58am UTC](https://community.parseplatform.org/t/parseswift-login-examples-for-apple-facebook-google-login/2481/3 "2022-03-09T05:58:46Z")

</div>

Corey,

Thank you so much for taking the time. This was a tremendous help. I was able to log on using an Apple ID.

I did need to add var access\_token: String? to my User class to log in. This was for the Back4App back end.

---

<div class="post-metadata">

**Author:** ![cbaker6](https://community.parseplatform.org/user_avatar/community.parseplatform.org/cbaker6/32/114_2.png) [@cbaker6](https://community.parseplatform.org/u/cbaker6)\
**Post date:** [March 9, 2022, 7:21am UTC](https://community.parseplatform.org/t/parseswift-login-examples-for-apple-facebook-google-login/2481/4 "2022-03-09T07:21:41Z")

</div>

> [@jem5519](#):
>
> I did need to add var access\_token: String? to my User class to log in. This was for the Back4App back end.

I’m not familiar with how Back4App works, but this is not required for ParseSwift with an out-of-the-box parse-server. In addition, using underscores in variable names isn’t standard in Swift. The standard is camel case, i.e. `accessToken`, You will want to ensure you follow the directions for [configuring the server with apple](https://docs.parseplatform.org/parse-server/guide/#configuring-parse-server-for-sign-in-with-apple). If you are using Back4app, I recommend you contact their support team to verify their requirements.
