Search results for

ASWebAuthenticationSession cookie

1,295 results found

Post

Replies

Boosts

Views

Activity

Access denied (Error code 1020) on WKWebView
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
0
0
811
Feb ’23
Reply to ASWebAuthenticationSession with Universal link never dismiss the sign-in screen
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:
Feb ’23
ASWebAuthenticationSession doesn't work as expected
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
1
0
1.6k
Feb ’23
Reply to ASWebAuthenticationSession callbackURLScheme
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:
Jan ’23
macOS SSO extension runs into a loop in redirect
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
2
0
1.3k
Jan ’23
AVPlayer with signed cookie
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
0
0
798
Jan ’23
WebAnalytics & WKWebView on iOS16, cookies cannot be used to identify users?
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
0
0
345
Jan ’23
Using a device identity certificate in WKWebView
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?
1
0
979
Jan ’23
Safari in iPhone simulators Can not open pages!!
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
0
0
677
Dec ’22