Search results for

ASWebAuthenticationSession cookie

1,295 results found

Post

Replies

Boosts

Views

Activity

SameSite cookie in Safari web extension
I'm porting a Chrome extension to Safari. All works well besides the auth flow, which uses SameSite=Strict cookies. On Chrome, such cookies are easily set and work as expected, but not on Safari. Now, as I understand, technically, requests from chrome-extension:// and safari-web-extension:// origins are cross-site in relation to the server, which makes me think that on Chrome, the SameSite=Strict attribute is simply ignored as an exception for extensions. With that said, the backend team wants to keep the attribute for security reasons and so removing it or replacing it with SameSite=None isn't an option. Is this an intended behavior of Safari or a bug? Is there a way to get around this without changing the attribute?
2
0
2.1k
Jul ’23
Reply to WKWebView sometimes lose cookies after the app returns from suspension
Facing similar issue with WKWebkit. After few hours of resuming the app, the cookies are getting cleared automatically. I am using below code - let webConfiguration = WKWebViewConfiguration() webConfiguration.websiteDataStore = WKWebsiteDataStore.default() let contentController = WKUserContentController() webConfiguration.userContentController = contentController webConfiguration.allowsInlineMediaPlayback = true webConfiguration.preferences = preferences webKitView = WKWebView(frame: webContentView.bounds, configuration: webConfiguration) Please suggest what to do ?
Topic: Safari & Web SubTopic: General Tags:
Feb ’24
Reply to Intercept WebView requests and add Auth token in all subsequent resource request [GET .js, .png, .css].
Usually in such cases you want to add tokens as a cookie attached to request, in that case you need to save that cookie to WKWebView first and then load page. At this point question is what your server expects? In which way that token must be passed? p.s. Those delegate methods that you mentioned are designed to be invoked only for main resources like HTML pages and iframes so they are useless for sub-requests interception.
Topic: App & System Services SubTopic: Core OS Tags:
Feb ’24
Reply to Services Worker in WKWebView
Hi! Service Workers are not available for WKWebView, except if your app has web browser entitlement. You may try to use regular Workers instead and store data in IndexedDB, LocalStorage or Cookies. Read here about Service Workers in WKWebView: https://forums.developer.apple.com/forums/thread/722160
Topic: Safari & Web SubTopic: General Tags:
Feb ’24
Can't access "More Tools" at https://developer.apple.com/download/all/
It all started an hour ago when I tried to download the Network Link Conditioner (I need to test the macOS application I'm developing with a slower network connection). I went to XCode > Open Developer Tool > More Developer Tool. It opens a Sing In page for apple developer. When I sign in with my account, it just refreshes the page and asks me to Sign In all over, stuck in a loop. Otherwise, I'm able to Sign In to all the other parts of the developer website, I have an active membership, all license agreements are up to date. Apple's status site shows everything operational. What I tried: Clearing cookies & cache Different browsers (including Safari) Updating & restarting everything Navigating from https://developer.apple.com/download/ to More tab on the website instead of going through XCode Signing in with a passkey instead of a password Tried using a VPN Going to the Developer Support page (https://developer.apple.com/support/) and trying to press Get Started to reach out to support
2
0
628
Nov ’23
Trying to clear trusted self-signed URLCredential's from WKWebView
Hi,One of the features of a browsing component am working on is to allow users to visit a potentially dangerous site (with a self-signed certificate for example) after being shown a warning explaining the dangers of said site and so on.Have successfully allowed this by implementing the `WKNavigationDelegate` method:func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void)and returning a `URLCredential` using the `URLCredential(trust: someTrust)`, where `someTrust` is found in the challenge's protection space and the authentication method matches `NSURLAuthenticationMethodServerTrust`The problem I am having is that the browsing component is also supposed to be able to clear any currently trusted sites without losing the current back/forward list.Short of blowing away the `WKWebView` instance and initializing a new one with a new `WKWebViewConfiguration`, I am unable to acheive this. Am tryi
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
768
Feb ’19
Reply to Safari keeps logging me out of websites
I'm getting exactly the same issue since upgrading to Sonoma 14.2.1 on a M1 Mac mini. I observe YouTube constantly logging me out (sometimes within an hour of a login) and also news.bbc.co.uk losing cookies and asking me to accept cookie preferences again. Did you file a bug report ? If so what is the reference number and I will add my views to it.
Topic: Safari & Web SubTopic: General Tags:
Jan ’24
Reply to ASWebAuthenticationSession initiated session, file:// URL is not loaded and "Confirm the file to load" is presented instead
While this doesn't directly answer your question, hopefully it's a better alternative. Starting in iOS 17.4 and macOS 14.4, you can now set additional headers in ASWebAuthenticationSession. https://developer.apple.com/documentation/authenticationservices/aswebauthenticationsession/4316246-additionalheaderfields
Topic: App & System Services SubTopic: Core OS Tags:
Jan ’24
ASWebAuthenticationSession initiated session, file:// URL is not loaded and "Confirm the file to load" is presented instead
We are relying on ASWebAuthenticationSession to do web authentication. Since the API doesn't support POST requests directly we have to generate local file in ~/Library/Application Support//WebAuth.html containing the POST and use initial URL as file:///Users//Library/Application%20Support//WebAuth.html Problem is that Safari sometimes pops a dialog Confirm the file to load and sometimes it doesn't. This doesn't depend on Full Disk access TCC. Does anybody know a way to prevent this from happening? MDM option or something? Also styling of the popup is a rather poor UI choice - looks very confusing and like the user may choose another file to load. Chrome f.e. doesn't do such popups. I already have FB13340210 for this.
1
0
1.2k
Jan ’24
Are PWA App Data and Cookies Cleared When iPad Turned Off for Long Periods
Hi, Getting reports from a client that they are being asked to re-login to their PWA (saved to their home screen) whenever they turn off their iPads for periods of 1-2hrs and then turn it back on again. Just noting, this isn't related to the 7 day cap on cookie data in webkit as we've already addressed this. I've tested just turning it off for a few minutes on a standard iPhone with iOS17 but don't experience the same issue. Does anyone know if it is part of iOS's device restart to clear PWA cookies etc. if the device has been off for a long time? The only other avenue I can think of is that the client's devices may have some MDM setting for this. Thanks in advance.
1
0
1.5k
Oct ’23
Reply to Are PWA App Data and Cookies Cleared When iPad Turned Off for Long Periods
I hope you're doing well. I noticed your post about users being prompted to re-login to the PWA on their iPads after turning them off for extended periods. It's an interesting challenge. I was wondering if you've received any responses or insights from the community regarding this issue. Additionally, have you been able to identify a solution or root cause for the re-login prompt? If there's any further information you can share, it would be helpful. Also, I came across https://www.netguru.com/blog/how-to-share-session-cookie-or-state-between-pwa-in-standalone-mode-and-safari-on-ios with some information related to PWAs and iOS behavior. Have you had a chance to explore this resource? Looking forward to hearing more about your progress.
Topic: App & System Services SubTopic: Core OS Tags:
Jan ’24
Reply to What's the best approach to introduce user authentication for VisionOS
While I'm not familiar with Auth0's API, it sounds like it's a wrapper for ASWebAuthenticationSession. ASWebAuthenticationSession is fully supported on visionOS and is great if you need users to authenticate through a web browser rather than in native UI. If you want your app to really shine, native sign-in within an app always feels better than jumping out to a web browser. For that, ASAuthorizationController is the best experience. The ASAuthorization family of APIs allows you to make a combined request for multiple types of credentials, if you support it. If the only sign in method you support is passwords, it provides a nice native sheet offering any passwords the user has. If you also support other methods like passkeys or Sign in with Apple, you can make a single request with all of those credential types and the system will offer whatever credentials the user currently has. This WWDC session is primarily focused on passkeys, but also goes over several ASAuthorization use cases.
Topic: App & System Services SubTopic: Core OS Tags:
Jan ’24