dpogue commented on code in PR #1514: URL: https://github.com/apache/cordova-ios/pull/1514#discussion_r1898317261
########## CordovaLib/include/Cordova/CDVPlugin.h: ########## @@ -85,6 +89,74 @@ extern const NSNotificationName CDVViewWillTransitionToSizeNotification; #pragma mark - Plugin protocols +/** + A protocol for Cordova plugins to intercept and respond to server + authentication challenges through WebKit. + + Your plugin should implement this protocol and the + ``willHandleAuthenticationChallenge:completionHandler:`` method to return + `YES` if it wants to support responses to server-side authentication + challenges, otherwise the default NSURLSession handling for authentication + challenges will be used. + */ +@protocol CDVPluginAuthenticationHandler <NSObject> + +/** + Asks your plugin to respond to an authentication challenge. + + Return `YES` if the plugin is handling the challenge, and `NO` to fallback to + the default handling. + + - Parameters: + - challenge: The authentication challenge. + - completionHandler: A completion handler block to execute with the response. + This handler has no return value and takes the following parameters: + - disposition: The option to use to handle the challenge. For a list of + options, see `NSURLSessionAuthChallengeDisposition`. + - credential: The credential to use for authentication when the + `disposition` parameter contains the value + `NSURLSessionAuthChallengeUseCredential`. Specify `nil` to continue + without a credential. + - Returns: A Boolean value indicating if the plugin is handling the request. + */ +- (BOOL)willHandleAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler; Review Comment: @erisu Updated this to be `willHandleAuthenticationChallenge` and return a `BOOL` so that multiple plugins can have a chance to respond -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org