Skip to content

Commit

Permalink
chore: added warning against the usage of WKWebView for WebAuth
Browse files Browse the repository at this point in the history
  • Loading branch information
desusai7 committed Oct 10, 2024
1 parent b8de698 commit eeb0e40
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 0 additions & 2 deletions App/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,13 @@ class ViewController: UIViewController {
@IBAction func login(_ sender: Any) {
Auth0
.webAuth()
.provider(WebAuthentication.webViewProvider())
.logging(enabled: true)
.start(onAuth)
}

@IBAction func logout(_ sender: Any) {
Auth0
.webAuth()
.provider(WebAuthentication.webViewProvider())
.logging(enabled: true)
.clearSession(federated: false) { result in
switch result {
Expand Down
2 changes: 2 additions & 0 deletions Auth0/WebViewProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
@preconcurrency import WebKit


/// WARNING: The use of `webViewProvider` is not recommended and contravenes the guidelines of the OAuth Protocol, which advises against using `WKWebView` for WebAuth.
/// The recommended approach is to utilize `ASWebAuthenticationSession`. Employ the provider below only if you fully understand the associated risks and are confident in your decision.
public extension WebAuthentication {
static func webViewProvider(style: UIModalPresentationStyle = .fullScreen) -> WebAuthProvider {
return { url, callback in
Expand Down

0 comments on commit eeb0e40

Please sign in to comment.