You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Parse-Swift currently supports Anonymous authentication (ParseAnonymous) and Apple authentication (see all adapters below).
Microsoft Graph, Meetup, or any other Parse Server supported authentication method works, 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 folder inside of the Sources->ParseSwift->Authentication->3rd Party folder and name it ParseNAME, for example ParseFacebook
Inside of the new folder, create a new files named: ParseNAME.swift, ParseNAME-async.swift, ParseNAME-combine.swift.
Refactor test files by: a) Find/replace Google -> Name, b) Find/replace google -> name
Submit your pull request for review
Note that the dependency of the the respective framework, i.e. import FBSDKCoreKit should not 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 to 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
Facebook
Github
Google
Instagram
Janrain Capture
Janrain Engage
Keycloak
LDAP
LinkedIn
Meetup
Microsoft Graph
OTP
PhantAuth
QQ
Spotify
Twitter
vKontakte
WeChat
Weibo
Alternatives / Workarounds
To authenticate without helper methods, you can use the following available on any ParseUser:
Makes an *asynchronous* request to log in a user with specified credentials.
Returns an instance of the successfully logged in `ParseUser`.
This also caches the user locally so that calls to *current* will use the latest logged in user.
- parameter type: The authentication type.
- parameter authData: The data that represents the authentication.
See [supported 3rd party authentications](https://docs.parseplatform.org/parse-server/guide/#supported-3rd-party-authentications) for more information.
- parameter options: A set of header options sent to the server. Defaults to an empty set.
- parameter callbackQueue: The queue to return to after completion. Default value of .main.
- parameter completion: The block to execute.
It should have the following argument signature: `(Result<Self, ParseError>)`.
Makes an *asynchronous* request to link a user with specified credentials. The user should already be logged in.
Returns an instance of the successfully linked `ParseUser`.
This also caches the user locally so that calls to *current* will use the latest logged in user.
- parameter type: The authentication type.
- parameter authData: The data that represents the authentication.
See [supported 3rd party authentications](https://docs.parseplatform.org/parse-server/guide/#supported-3rd-party-authentications) for more information.
- parameter options: A set of header options sent to the server. Defaults to an empty set.
- parameter callbackQueue: The queue to return to after completion. Default value of .main.
- parameter completion: The block to execute.
It should have the following argument signature: `(Result<Self, ParseError>)`.
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
desires a different policy, it should be inserted in `options`.
New Feature / Enhancement Checklist
Current Limitation
Parse-Swift currently supports Anonymous authentication (ParseAnonymous) and Apple authentication (see all adapters below).
Microsoft Graph, Meetup, or any other Parse Server supported authentication method works, 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:
Sources->ParseSwift->Authentication->3rd Party
folder and name itParseNAME
, for exampleParseFacebook
ParseNAME.swift
,ParseNAME-async.swift
,ParseNAME-combine.swift
.Google
->Name
, b) Find/replacegoogle
->name
ParseNAME.swift
.Google
->Name
, b) Find/replacegoogle
->name
Note that the dependency of the the respective framework, i.e.
import FBSDKCoreKit
should not be part of the PR as Parse-Swift is dependency free. Instead, the implementation should just ensure the necessaryAuthenticationKeys
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 to 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):
Alternatives / Workarounds
To authenticate without helper methods, you can use the following available on any
ParseUser
:Parse-Swift/Sources/ParseSwift/Authentication/Protocols/ParseAuthentication.swift
Lines 231 to 382 in 11bb8e6
and here:
Parse-Swift/Sources/ParseSwift/Authentication/Protocols/ParseAuthentication+combine.swift
Lines 34 to 89 in 11bb8e6
3rd Party References
The text was updated successfully, but these errors were encountered: