Description
New Feature / Enhancement Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
Current Limitation
Parse-Swift currently supports Anonymous authentication (ParseAnonymous) and Apple authentication (see all adapters below).
Microsoft Graph, Instagram, and any Parse Server supported authentication method do work, but they currently don't have helper methods to connect to them as easily as using ParseApple
.
Populating authData
directly requires knowing the correct key/values for the respective adapter and can quickly lead to mistakes in code during login, linking, etc.
Feature / Enhancement Description
To make the process simpler, developers can easily add support for additional 3rd party authentication methods by using ParseGoogle as a template.
Example Use Case
We are encouraging developers to open PR's (see the contributors guide) to add missing authentication methods by following the process below:
- Create a new file inside the 3rd Party folder and name it
ParseNAME.swift
, for exampleParseFacebook
. - Copy the code from ParseGoogle.swift, ParseGoogle+async.swift, ParseGoogle+combine.swift into the new respective adapter files you are creating.
- Refactor by: a) Find/replace
Google
->Name
, b) Find/replacegoogle
->name
- Modify/tailor the helper methods to work with the specific SDK. This will require modifying
AuthenticationKeys
in the file. - Add any additional methods that may be needed to verify inputs or simplify passing in values to the method.
- Update documentation/comments in the code to reflect the new adapter
- Copy/modify the ParseGoogleTests.swift, ParseGoogleCombineTests.swift file to add the respective test cases.
- Refactor test files by: a) Find/replace
Google
->Name
, b) Find/replacegoogle
->name
- Submit your pull request for review
Note that the dependency of the the respective framework, i.e. import FBSDKCoreKit
shouldn't be part of the PR as Parse-Swift is dependency free. Instead the implementation should just ensure the necessary AuthenticationKeys
are captured to properly authenticate the respective framework with a Parse Server. The developer using the respective authentication method is responsible for adding any dependencies for their app. This lets the developer manage and use any version of any authentication SDK's they want, they simply need to specify the required keys that the Parse Server requires.
If you need help, feel free to ask questions here or in your added PR.
Potential adapters (checked one’s are already implemented in Parse-Swift):
- Apple
- Github
- Janrain Capture
- Janrain Engage
- Keycloak
- LDAP
- Meetup
- Microsoft Graph
- PhantAuth
- Spotify
- vKontakte
Alternatives / Workarounds
To authenticate without helper methods, you can use the following available on any ParseUser
:
and here: