apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.15k stars 987 forks source link

[RFC] support authentication challenge callback via plugin #1212

Open brodybits opened 2 years ago

brodybits commented 2 years ago

Platforms affected

iOS

Motivation and Context

I think it would be nice if we could support plugins that can handle an authentication challenge coming from the server, namely this callback on WKWebView:

It would help support this functionality in a plugin that I maintain:

Description

This proposal adds a handler for a "didReceiveAuthenticationChallenge" callback from the WKWebView, and hands it off to a plugin if possible.

I am raising this proposal now to see whether or not there is sufficient interest to justify any further work. A couple major TODO items:

Alternative solution: leave this functionality up to a native XHR plugin to support, which is good enough for my customer need right now

Testing

Tested with this proposal on my plugin:

Checklist

codecov-commenter commented 2 years ago

Codecov Report

Merging #1212 (c194fc0) into master (67b0bb2) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1212   +/-   ##
=======================================
  Coverage   78.53%   78.53%           
=======================================
  Files          15       15           
  Lines        1761     1761           
=======================================
  Hits         1383     1383           
  Misses        378      378           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 67b0bb2...c194fc0. Read the comment docs.