cordova-ios icon indicating copy to clipboard operation
cordova-ios copied to clipboard

[RFC] support authentication challenge callback via plugin

Open brody4hire opened this issue 3 years ago • 1 comments

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:

  • https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview?language=objc

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

  • https://github.com/cordova-ccafix/cordova-plugin-client-certificate-support/issues/7

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:

  • [ ] cleanup logging
  • [ ] cleanup some comments
  • [ ] find a better completion strategy than "first plugin wins"

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:

  • https://github.com/cordova-ccafix/cordova-plugin-client-certificate-support/pull/12

Checklist

  • [ ] I've run the tests to see all new and existing tests pass
  • [ ] I added automated test coverage as appropriate for this change
  • [ ] Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • [ ] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • [ ] I've updated the documentation if necessary

brody4hire avatar Dec 21 '21 04:12 brody4hire

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.

codecov-commenter avatar Dec 21 '21 04:12 codecov-commenter