-
Notifications
You must be signed in to change notification settings - Fork 231
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
Document Legacy Grant Types & Method deprecations #126
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,7 +82,10 @@ public protocol Authentication: Trackable, Loggable { | |
|
||
- returns: authentication request that will yield Auth0 User Credentials | ||
- seeAlso: Credentials | ||
- warning: this method is deprecated in favor of `login(usernameOrEmail username:, password:, realm:, audience:, scope:)` | ||
- requires: Legacy Grant `http://auth0.com/oauth/legacy/grant-type/ro`. Check [our documentation](https://auth0.com/docs/clients/client-grant-types) for more info and how to enable it. | ||
*/ | ||
@available(*, deprecated, message: "see login(usernameOrEmail username:, password:, realm:, audience:, scope:)") | ||
// swiftlint:disable:next function_parameter_count | ||
func login(usernameOrEmail username: String, password: String, multifactorCode: String?, connection: String, scope: String, parameters: [String: Any]) -> Request<Credentials, AuthenticationError> | ||
|
||
|
@@ -118,6 +121,7 @@ public protocol Authentication: Trackable, Loggable { | |
- parameter scope: scope value requested when authenticating the user. | ||
- important: This only works if you have the OAuth 2.0 API Authorization flag on | ||
- returns: authentication request that will yield Auth0 User Credentials | ||
- requires: Grant `http://auth0.com/oauth/grant-type/password-realm`. Check [our documentation](https://auth0.com/docs/clients/client-grant-types) for more info and how to enable it. | ||
*/ | ||
func login(usernameOrEmail username: String, password: String, realm: String, audience: String?, scope: String?) -> Request<Credentials, AuthenticationError> | ||
|
||
|
@@ -222,7 +226,9 @@ public protocol Authentication: Trackable, Loggable { | |
- parameter parameters: additional parameters sent during authentication | ||
|
||
- returns: an authentication request that will yield Auth0 user credentials after creating the user. | ||
- requires: Legacy Grant `http://auth0.com/oauth/legacy/grant-type/ro`. Check [our documentation](https://auth0.com/docs/clients/client-grant-types) for more info and how to enable it. | ||
*/ | ||
@available(*, deprecated, message: "use createUser(email:, username:, password:, connection:, userMetadata:) and then login(usernameOrEmail username:, password:, realm:, audience:, scope:)") | ||
// swiftlint:disable:next function_parameter_count | ||
func signUp(email: String, username: String?, password: String, connection: String, userMetadata: [String: Any]?, scope: String, parameters: [String: Any]) -> ConcatRequest<DatabaseUser, Credentials, AuthenticationError> | ||
|
||
|
@@ -251,6 +257,7 @@ public protocol Authentication: Trackable, Loggable { | |
- parameter parameters: additional authentication parameters added for Web link. Ignored in other types | ||
|
||
- returns: a request | ||
- requires: Legacy Grant `http://auth0.com/oauth/legacy/grant-type/ro`. Check [our documentation](https://auth0.com/docs/clients/client-grant-types) for more info and how to enable it. | ||
*/ | ||
func startPasswordless(email: String, type: PasswordlessType, connection: String, parameters: [String: Any]) -> Request<Void, AuthenticationError> | ||
|
||
|
@@ -278,6 +285,7 @@ public protocol Authentication: Trackable, Loggable { | |
- parameter connection: name of the passwordless connection. By default is 'sms' | ||
|
||
- returns: a request | ||
- requires: Legacy Grant `http://auth0.com/oauth/legacy/grant-type/ro`. Check [our documentation](https://auth0.com/docs/clients/client-grant-types) for more info and how to enable it. | ||
*/ | ||
func startPasswordless(phoneNumber: String, type: PasswordlessType, connection: String) -> Request<Void, AuthenticationError> | ||
|
||
|
@@ -290,12 +298,12 @@ public protocol Authentication: Trackable, Loggable { | |
.tokenInfo(token: token) | ||
.start { print($0) } | ||
``` | ||
|
||
- parameter token: token obtained by authenticating the user | ||
|
||
- warning: this method is deprecated in favor of `userInfo(withAccessToken accessToken:)` | ||
- returns: a request that will yield token information | ||
*/ | ||
@available(*, deprecated, message: "see userInfo(token: String)") | ||
@available(*, deprecated, message: "see userInfo(withAccessToken accessToken:)") | ||
func tokenInfo(token: String) -> Request<Profile, AuthenticationError> | ||
|
||
/** | ||
|
@@ -311,7 +319,7 @@ public protocol Authentication: Trackable, Loggable { | |
- parameter token: token obtained by authenticating the user | ||
|
||
- returns: a request that will yield user information | ||
- important: If you are using an OIDC Conformant client please see `userClaimInfo` | ||
- warning: for OIDC-conformant clients please use `userInfo(withAccessToken accessToken:)` | ||
*/ | ||
func userInfo(token: String) -> Request<Profile, AuthenticationError> | ||
|
||
|
@@ -358,6 +366,8 @@ public protocol Authentication: Trackable, Loggable { | |
- parameter parameters: additional parameters sent during authentication | ||
|
||
- returns: a request that will yield Auth0 user's credentials | ||
- warning: disabled for OIDC-conformant clients, an alternative will be added in a future release | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this warning There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add info of what grant type needs to be enabled and a link to the docs about grant type |
||
- requires: Legacy Grant `http://auth0.com/oauth/legacy/grant-type/access_token`. Check [our documentation](https://auth0.com/docs/clients/client-grant-types) for more info and how to enable it. | ||
*/ | ||
func loginSocial(token: String, connection: String, scope: String, parameters: [String: Any]) -> Request<Credentials, AuthenticationError> | ||
|
||
|
@@ -374,7 +384,7 @@ public protocol Authentication: Trackable, Loggable { | |
- parameter parameters: request parameters | ||
|
||
- returns: a request that will yield Auth0 user's credentials | ||
- seeAlso: Authentication#exchangeCode(codeVerifier:redirectURI:) for PKCE | ||
- seeAlso: exchangeCode(codeVerifier:, redirectURI:) for PKCE | ||
*/ | ||
func tokenExchange(withParameters parameters: [String: Any]) -> Request<Credentials, AuthenticationError> | ||
|
||
|
@@ -525,6 +535,7 @@ public extension Authentication { | |
|
||
- returns: authentication request that will yield Auth0 User Credentials | ||
- seeAlso: Credentials | ||
- requires: Legacy Grant `http://auth0.com/oauth/legacy/grant-type/ro`. Check [our documentation](https://auth0.com/docs/clients/client-grant-types) for more info and how to enable it. | ||
*/ | ||
public func login(usernameOrEmail username: String, password: String, multifactorCode: String? = nil, connection: String, scope: String = "openid", parameters: [String: Any] = [:]) -> Request<Credentials, AuthenticationError> { | ||
return self.login(usernameOrEmail: username, password: password, multifactorCode: multifactorCode, connection: connection, scope: scope, parameters: parameters) | ||
|
@@ -561,6 +572,7 @@ public extension Authentication { | |
- parameter audience: API Identifier that the client is requesting access to. | ||
- parameter scope: scope value requested when authenticating the user. | ||
- Returns: authentication request that will yield Auth0 User Credentials | ||
- requires: Grant `http://auth0.com/oauth/grant-type/password-realm`. Check [our documentation](https://auth0.com/docs/clients/client-grant-types) for more info and how to enable it. | ||
*/ | ||
public func login(usernameOrEmail username: String, password: String, realm: String, audience: String? = nil, scope: String? = nil) -> Request<Credentials, AuthenticationError> { | ||
return self.login(usernameOrEmail: username, password: password, realm: realm, audience: audience, scope: scope) | ||
|
@@ -652,6 +664,7 @@ public extension Authentication { | |
- parameter parameters: additional parameters sent during authentication | ||
|
||
- returns: an authentication request that will yield Auth0 user credentials after creating the user. | ||
- requires: Legacy Grant `http://auth0.com/oauth/legacy/grant-type/ro`. Check [our documentation](https://auth0.com/docs/clients/client-grant-types) for more info and how to enable it. | ||
*/ | ||
public func signUp(email: String, username: String? = nil, password: String, connection: String, userMetadata: [String: Any]? = nil, scope: String = "openid", parameters: [String: Any] = [:]) -> ConcatRequest<DatabaseUser, Credentials, AuthenticationError> { | ||
return self.signUp(email: email, username: username, password: password, connection: connection, userMetadata: userMetadata, scope: scope, parameters: parameters) | ||
|
@@ -740,6 +753,7 @@ public extension Authentication { | |
- parameter parameters: additional parameters sent during authentication | ||
|
||
- returns: a request that will yield Auth0 user's credentials | ||
- requires: Legacy Grant `http://auth0.com/oauth/legacy/grant-type/access_token`. Check [our documentation](https://auth0.com/docs/clients/client-grant-types) for more info and how to enable it. | ||
*/ | ||
public func loginSocial(token: String, connection: String, scope: String = "openid", parameters: [String: Any] = [:]) -> Request<Credentials, AuthenticationError> { | ||
return self.loginSocial(token: token, connection: connection, scope: scope, parameters: parameters) | ||
|
@@ -762,7 +776,7 @@ public extension Authentication { | |
.start { print($0) } | ||
``` | ||
|
||
If you are not using OAuth 2.0 API Authorization please use `delegation(parameters:)` | ||
- precondition: if you are not using OAuth 2.0 API Authorization please use `delegation(parameters:)` | ||
|
||
- parameter refreshToken: the client's refresh token obtained on auth | ||
- parameter scope: scopes to request for the new tokens. By default is nil which will ask for the same ones requested during Auth. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add info of what grant type needs to be enabled and a link to the docs about grant type