iOS Development

ios – Forgerock SDK biometrics authentication in WKWebView

I used to be utilizing the Forgerock SDK for passwordless biometric authentication. Now we have accomplished our server setup, and the URL is as follows:
https://sandbox.instance.com/kauth/XUI/?realm=test-sandbox&service=biometricAuth

class WebViewController: UIViewController {
    // MARK: - Propertie's
    @IBOutlet weak var loginWebView: WKWebView!
    // MARK: - View Life cycles
    override func viewDidLoad() {
        tremendous.viewDidLoad()
        // Do any extra setup after loading the view.
        self.loginWebView.navigationDelegate = self
        self.loadURL()            
    }
    
    func loadURL() {
        let url = URL(string: "https://sandbox.instance.com/kauth/XUI/?realm=test-sandbox&service=biometricAuth")!
        loginWebView.load(URLRequest(url: url))
        loginWebView.allowsBackForwardNavigationGestures = true
    }
}
extension WebViewController: WKNavigationDelegate {
func webView(_ webView: WKWebView, didReceive problem: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
        let cred = URLCredential(belief: problem.protectionSpace.serverTrust!)
        completionHandler(.useCredential, cred)
    }
}

I had WKWebView open and loaded the URL. After I completed logging in, I began getting callbacks saying issues like, “Machine registered,” “Not register like that,” and “Is it potential to do in webview or will it work solely in native?”

SDK Reference Hyperlink

Credit: www.ismmailgsm.com

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button