Search results for

ASWebAuthenticationSession cookie

1,295 results found

Post

Replies

Boosts

Views

Activity

Cookies set by AJAX responses not accessible by JS when using WKWebView
Hi, we have really weird issue with one of our website embedded into iOS app using WKWebView. The website has CSRF mechanism implemented and is using some AJAX calls when user interact with it and in response some cookies are returned. Then the JS code wants to access these cookies to set proper value for next request header. Unfortunately when using document.cookie JS command these cookies are not there. However they are sent within another requests and I can see them from Safari Developer Inspector connected to my device or iOS Simulator. Another interesting thing is that the same website and solution works fine on Safari browser and with SFSafariViewController displayed inside our app. We've tried using various things for WKWebView configuration like nonPersistent data store, but without success. Does anyone have any idea how to deal with such issue and why it doesn't work with WKWebView?
Topic: Safari & Web SubTopic: General Tags:
1
0
583
Jun ’24
Guideline 5.1.1 - Legal - Privacy - Data Collection and Storage
Hi, I have an issue with App submission. My flow is: show third party cookie consent banner (is an external SDK) show ATT Apple with this message Allowing tracking will enable more personalized ads for you. Apple says this: You collect data to track after the user selects Ask App Not to Track on the App Tracking Transparency permission request. Specifically, we noticed the app accesses web content you own and collects cookies for tracking after the user asked you not to track them. Next Steps To resolve this issue, please revise the app so that you do not collect data for tracking purposes if the user does not give permission for tracking. Alternatively, if you do not collect cookies for tracking purposes, revise the cookie prompts that appear in the app to clarify you do not track users. in the rejection they put the ATT alert and the third party banner as the screen Do you have any input on this as Apple never says things clearly about what the problem is. Thank you
3
0
1.4k
Jun ’24
Reply to CFNetwork Exception Issue Impacting Large Number of Users, Primarily on iOS 17
Starting with the quick question: I've noticed that in every crash report's stack trace, there is always a thread that includes JavaScriptCore. Could you please take a look at what it's doing? Basically, nothing? Strictly speaking, it's blocked in scavenger_thread_main, which is part of libpas a custom malloc implementation WebKit uses. WebKit has a nice write up of libpas and The Scavenger, but the direct answer is that it's just idling waiting for the next time it runs. I would like to ask, why would this problem occur when sorting cookies? What operation is this function performing that leads to the crash? The term sort there is slightly misleading. It's sort as in compare these two cookies and tell me which should be first, not please sort this big list of cookies. The actual crash is caused by dereferencing a pointer that references the domain name and which should not be NULL. It's doing that as part of inserting a cookie into the cookie store, which is what
Jun ’24
ASWebAuthenticationSession with callbackURLScheme prior to iOS 17.4 not working as expected
I am trying to auth with a non-apple auth provider for a multi-platform service. I'm expecting to be able to use this to fetch the OAuth code after the user logs in to their auth provider. myRedirectHost = 'https' OR 'https://my.domain.com' where I also know the redirect path and query params and will extract them. ASWebAuthenticationSession(url: url, callbackURLScheme: myRedirectHost, completionHandler: handleAuthSessionResult) This works for iOS 17.4+ with that nice enum, but what about the rest of the users?
1
0
799
Jun ’24
Reply to CFNetwork Exception Issue Impacting Large Number of Users, Primarily on iOS 17
Thank you Kevin Elliott! I would like to ask, why would this problem occur when sorting cookies? What operation is this function performing that leads to the crash? If the crash is caused by a specific cookie value, could you tell me which specific attribute of the cookie is causing the problem? In addition, I tried to set breakpoints for these symbols in Xcode, but was unsuccessful. Could you tell me how to correctly set breakpoints so that I can better debug this problem? I really hope to get some specific tips so that I can better solve this problem. I really appreciate your help.
Jun ’24
Reply to CFNetwork Exception Issue Impacting Large Number of Users, Primarily on iOS 17
Hi, First off, the reason you weren't able to symbolicate the original logs is that the library UUID is missing from the crash logs. With a bit of digging I found crash logs that included CFNetwork from both system version. Here are the original and corrected library entries: Crash 1/iOS 17.5.1 (21F90): 0x19b497000 - 0x19b873fff CFNetwork arm64e /System/Library/Frameworks/CFNetwork.framework/CFNetwork 0x19b497000 - 0x19b873fff CFNetwork arm64e /System/Library/Frameworks/CFNetwork.framework/CFNetwork Crash 2/iOS 17.4.1 (21E236): 0x18ef9a000 - 0x18f376fff CFNetwork arm64e /System/Library/Frameworks/CFNetwork.framework/CFNetwork 0x18ef9a000 - 0x18f376fff CFNetwork arm64e /System/Library/Frameworks/CFNetwork.framework/CFNetwork With the right UUIDs, both logs symbolicate to this stack: Thread 50 Crashed: 0 CFNetwork 0x000000019b534d2c cookieHeaderSort(CompactCookieHeader const*, CompactCookieHeader const*) (in CFNetwork) + 28 1 CFNetwork 0x000000019b534a1c CompactCookieArray::_mungeCookies(CompactCookieArray co
Jun ’24
ASWebAuthenticationSession and error code 1
We're using this (on a mac) to do 3rd party authentication. The completion handler is getting Authentication session got error: [The operation couldn’t be completed. (com.apple.AuthenticationServices.WebAuthenticationSession error 1.)], in domain: [com.apple.AuthenticationServices.WebAuthenticationSession] That seems to be generated if the auth window is closed. However... it's not being closed, so we end up spawning a second one to do it, and this one seems to work.
2
0
1.4k
Jun ’24
Reply to SFSafariViewControllerDelegate method for initialLoadDidRedirectTo not being triggered for subsequent reloads as specified in the docs
[quote='756391021, MichaellisAngi, /thread/756391, /profile/MichaellisAngi'] I am allowing a user to log in with an OAuth 2.0 Provider on the Safari browser and expecting to detect the redirect to continue the flow from the app once their credentials have securely been consumed by the IdP in Safari. [/quote] This API allows you to determine how a shortened or obscured URL might unfurl, but we intentionally restrict the returned URLs to preserve user privacy. From the use case you describe, I think you'd be better served using ASWebAuthenticationSession, as there really are not hard guarantees here. Specifically we shipped a new API for ASWebAuthenticationSession which allows specifying an https callback. let session = ASWebAuthenticationSession( url: URL(string: https://example.com/signIn)!, callback: .https(host: mycoolsite.com, path: /auth) // New API ) { callbackURL, error in guard let callbackURL else { return } signIn(using: callbackURL) } session.presentationContextProvider =
Topic: Safari & Web SubTopic: General Tags:
Jun ’24
Reply to IS anyone using ASWebAuthenticationSession with matchesURL method?
If you're adopting ASWebAuthenticationSession for signing in to your app, you shouldn't need to call matchesURL() (except maybe for debugging purposes). That method exists mainly for web browsers that implement handling of ASWebAuthenticationSession requests. To use ASWebAuthenticationSession for signing in, you probably want something like let session = ASWebAuthenticationSession(url: URL(string: https://example.com/signIn)!, callback: .https(host: mycoolsite.com, path: /auth)) { callbackURL, error in guard let callbackURL else { ... } finishMySignIn(with: callbackURL) } session.presentationContextProvider = presentationContextProvider session.start() This will open https://example.com/signIn in a browser context, and watch for a redirect to a URL that starts with https://mycoolsite.com/auth. When a page matching that URL gets loaded, you'll get the full URL in the callbackURL argument, which should have the necessary auth tokens. Note that for custom schemes, there's no n
Topic: App & System Services SubTopic: Core OS Tags:
May ’24
Transparent Proxy Provider (again) and IPSec: should it work?
As I've mentioned multiple times, we've discovered some very annoying failures when using a TPP, including FaceTime, AirDrop, and some VPNs. (Tailscale works fine, weirdly enough.) In doing some experimentation today with FortiNet, I was able to get the TPP to work if I added the FortiNet server (which, in our case, is an amazon VM) to the TPP's excludedNetworks list. While it is not working, the tcpdump I got for the host was: 15:15:35.584029 IP (tos 0x0, ttl 64, id 1976, offset 0, flags [none], proto UDP (17), length 412) 192.168.43.16.55067 > ${hidden}.ipsec-msft: [udp sum ok] NONESP-encap: isakmp 1.0 msgid 00000000 cookie d66f571dcfc483ba->0000000000000000: phase 1 I ident: (sa: doi=ipsec situation=identity (p: #1 protoid=isakmp transform=2 (t: #1 id=ike (type=lifetype value=sec)(type=lifeduration len=4 value=00015180)(type=enc value=aes)(type=keylen value=0080)(type=auth value=fde9)(type=hash value=sha1)(type=group desc value=modp2048)) (t: #2 id=ike (type=lifetype value=sec)(type=lifedura
3
0
628
May ’24
Cookie sharing between ASWebAuthenticationSession and Safari (ios)
I'm currently trying to add an OIDC connection to an iOS application. I'm using AppAuth, which will use ASWebAuthenticationSession (because we're targeting recent versions of iOS). We have a login web page that will write a cookie. We'd like this cookie to be shared between the application (using ASWebAuthenticationSession) and the system browser (Safari) so that the user can be recognized and avoid having to log in again. The web page writes a permanent cookie (with an expiry date) and the iOS application uses ASWebAuthenticationSession. And I did not set prefersEphemeralSession to true. So we should be OK with the documentation (SFSafariViewController no longer shares cookies, and session cookies are not shared between ASWebAuthenticationSession and Safari). It should work, if I understand the documentation correctly. Did I miss a point? Or is it a known problem? I also tried to create a simple web page that read and write a cookie
1
0
1.7k
Apr ’24