Authentication with WKWebView in Swift

前端 未结 3 1988
长发绾君心
长发绾君心 2020-12-06 09:53

In my iOS app, I would like to use a WKWebView to wrap an external URL in the application. This URL requires basic authentication (it needs user and password credential, lik

3条回答
  •  清歌不尽
    2020-12-06 10:36

    Add the following line:

    completionHandler(NSURLSessionAuthChallengeDisposition.UseCredential, credential)
    

    at the end of didReceiveAuthenticationChallenge solved the problem.

提交回复
热议问题