This is most likely a new question as I have not seen any other question related. I am trying to connect to a cybersource payment endpoint using WKWebview on SwiftUI I get the error I have tried to set cookie but still won't work WebView public struct HTMLView: UIViewRepresentable { var url: String var javascriptString: String @Binding var webViewUIModel: UIModel public init(url: String, javascriptString: String = , webViewUIModel: Binding) { self.url = url self.javascriptString = javascriptString self._webViewUIModel = webViewUIModel } public func makeUIView(context: Context) -> WKWebView { // let webView = WKWebView() let webConfiguration = WKWebViewConfiguration() let store = WKWebsiteDataStore.default() webConfiguration.websiteDataStore = store webConfiguration.preferences.javaScriptCanOpenWindowsAutomatically = true webConfiguration.defaultWebpagePreferences.allowsContentJavaScript = true let webView = WKWebView(frame: .zero, configuration: webConfiguration) webView.navigationDelegate = conte
Search results for
ASWebAuthenticationSession cookie
1,295 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
UniversalLink and redirectURI are different things. OAuth standard protocol assumes that once the authentication part on the ASWebAuthenticationSession panel is completed successfully, the backend will redirect you to the URI indicated into the redirectURI parameter you used to instruct the request for the ASWebAuthenticationSession. If this doesn't happen for any reason (like a 302 on the redirectURI), then the ASWebAuthenticationSession isn't completed and your call back is never called.
Topic:
Programming Languages
SubTopic:
Swift
Tags:
ASWebAuthenticationSession works wrong when called second time in a row. So our web authentication code is organised like this: if let existingSession = ssoAuthSession { // closes the auth window but then request queue gets stuck: existingSession.cancel() } let session = ASWebAuthenticationSession(url: signinURL, callbackURLScheme: callbackScheme) { (receivedURL, error) in /// handle the result, DispatchQueue.main.async { // report the result self.ssoAuthSession = nil } } session.prefersEphemeralWebBrowserSession = true session.presentationContextProvider = delegate //delegate provides a valid app window if !session.canStart() { // report error, (doesn't happen) return } self.ssoAuthSession = session self.ssoAuthSession.start() The problem is, if the user initiates the SSO Authentication second time without closing the previous browser authentication window, that old window closes (as we cancelled the old session), but the new window never opens. This reproduces 100% on every default browser
Have you managed to solve that? Sometimes it works sometimes the cookies are not preserved.
Topic:
Safari & Web
SubTopic:
General
Tags:
Hi there, I am trying to do the same, with the Twitter API, however their first step of the OAuth flow seems to require a POST request, and I don't believe that ASWebAuthenticationSession gives that option. Would you confirm it is not possible to authenticate with the twitter API through ASWebAuthenticationSession ?
Topic:
App & System Services
SubTopic:
Core OS
Tags:
In iOS 16, passkeys can be used in a WKWebView if the client app is using Associated Domains for the relying party. For other relying parties, you can use passkeys in SFSafariViewController or ASWebAuthenticationSession.
Topic:
Privacy & Security
SubTopic:
General
Tags:
I need a way to accept third party cookies in WKWebViews. It seems the latest iOS is blocking my site from fully loading due to third party cookies.
Hi, I created an SSO extension that works fine. The extension triggers for my domain when I need to run an OIDC flow by the authorize path of my issuer. I finish the whole OIDC flow inside the extension and get the required parameters (access token, ID token, state, etc.), and build the Location header to return to the caller (in my case it triggers from Safari). I also attach the Set-Cookie with my cookies. For completion, I call the authorizationRequest?.complete(httpResponse: response, httpBody: nil) with a 302 code response I create which contains the cookies and the Location header. My problem is that the Safari gets the response with the redirect, removes the Extension, and a sec after the extension triggers again with the same authorize request. All this happens in a loop without stopping, unless I call authorizationRequest?.doNotHandle(). I checked the Location header to a similar one from a regular web flow that works fine (without the extension) and both are the same. Any
The behavior you've described sounds like the scheme you're passing to ASWebAuthenticationSession doesn't match the scheme for the URL being redirected to. Please double check that they match. (Keep in mind that a scheme itself doesn't include any special characters, such as : or /.)
Topic:
App & System Services
SubTopic:
Core OS
Tags:
My company offers lesson video for exercise. The video is applied signed cookie from AWS cloudFront infrastructure. When play video directly in iPhone(iPad), generated cookie is set to options like as below play well. let asset = AVURLAsset(url: url, options: cookies) But when try to play via AirPlay2 with other device (smart tv, Apple TV), Video player shows me a can't play. Of course, I implemented resource loader delegate and wrote codes as below func resourceLoader( _ resourceLoader: AVAssetResourceLoader, shouldWaitForLoadingOfRequestedResource loadingRequest: AVAssetResourceLoadingRequest ) -> Bool { guard let cookie = viewModel?.cookie else { return false } var newRequest = loadingRequest.request newRequest.headers = HTTPHeaders(cookie) let connection = URLSession.shared.dataTask(with: newRequest) { data, response, error in switch data { case let .some(data): loadingRequest.contentInformationRequest?.contentType = (response as! HTTPURLResponse).a
Some of the reason, our apps still use WKWebView to call Urchin WebAnalytics Software(Urchin/graylog) like Google analyzes traffic to record page view and user(first-time visitor / existing visitor). Before 12th Sep 2022, software still in function. After 12th Sep 2022, our team found that the software report field first-time visitor value is abnormal, a huge increase to about 200% every month. But other fileds are still good. I guess that it may be some behavior like cookies has been changed on iOS16 client side, but i am not good at networking. Does anyone know what happened in this case and how to solve. Many many thanks
Hi. I'm currently using WKWebView to load our application's SSO page through Microsoft and I'm need to access the device identity certificates for the NSURLAuthenticationMethodClientCertificate in order to bypass MFA via device trust. I've read it would be easier with SFSafariViewController, but that's not an option for me, as I need to set custom cookies prior to loading the page, a thing which I understand is not possible with SF. Is there any way to access these certificates through WKWebView? Or is there anything else I can use that would let me both set custom cookies and access device identity certificates?
fwiw I'm still running into this problem today with watchOS 9.1. HTTPCookieStorage.shared.cookies only appears to get set on non-redirected requests. This makes multi-redirect login/auth flows fail, because the cookie handshakes don't occur across redirects.
Topic:
App & System Services
SubTopic:
General
Tags:
I want to remove Cookies(Login) of SFSafariViewController.
Hi, Since I installed Xcode 14.x, all of my safari simulators can not open web pages, I have some applications that have to use Auth0 for login, and because of this issue, I can not test them on simulators. Now I am using: Macbook M1 Pro 16 macOS Ventura 13.1 (22C65) Xcode: 14.2 My mac OS Safari is not working very fast too. I restart Safari by clearing Cache, Cookies, proxies, and histories, pretty much whatever I can do for resetting Safari. But did not help. Google Chrome and Firefox are working very fast without any issues. so it is not my network problem. Any help? Thanks