I'm trying to use URLProtocol for implementing JWT authentication.The authentication flow would look like this:A request ist sent to the server. If the server returns 401 (WWW-Authenticate: Bearer realm="example.com"') the user needs to provide his credentials. With those credentials a request to the authentication server will return a valid access token. This access token is then used for the original request by setting a custom header.There are multiple issues I'm facing:didReceive challenge: URLAuthenticationChallenge, completionHandler is not called with Bearer authenticateioninside didReceive challenge: URLAuthenticationChallenge, completionHandler I don't find any way to append the header to the original requestif the user takes longer to provide his credentials than the timeout of the original request, the request would run into an timeoutIs seems that there is no way to use URLProtocol for handling token based authentication, is it?Is there any alternative suggested way to handle bearer authentication without using frameworks like Alamofire or Moya?
Post
Replies
Boosts
Views
Activity
Currently I'm showing a custom app smart banner. I want to hide the custom smart app banner when the user has already installed the app. Since I'm using universal links a banner to open the current page in the app is shown automatically. How can I detect the native smart app banner provided by Safari via JS?