Search results for

ASWebAuthenticationSession cookie

1,295 results found

Post

Replies

Boosts

Views

Activity

Reply to How to synchronize cookies in WKWebview
I to had the same issues with this WKHTTPCookieStorage, i created a wrapper method that would add an array of cookie async and on completion it would load the URLRequest in the WKWebView, however when it gets into decidePolicyFor navigationAction method the wkwebview cookies are not the ones i set before in WKHTTPCookieStorage, i believe WKProcessPool is the one responsible for the cookies to be in sync, and it seems that settings cookies in a webview that is created and has a configuration, does not mean that they will be in the wkwebview when the webpage starts loading. i actually created a post with what seems to be a similar issue to yours.https://forums.developer.apple.com/thread/97194It would be good to know if this is by design, or is it potentially a bug. If it is by design why does this happen, and what workarounds can be used.
Feb ’18
Reply to Setting cookies with WKHTTPCookieStorage do not sync with wkwebview
Hi,I have a similar problem. I used to sync HTTPCookieStorage with WKHTTPCookieStore with the following method.@available(iOS 11.0, *) func fillCookieStore(store: WKHTTPCookieStore, completionHandler: (() -> Void)? = nil) { DDLogDebug(HttpCookieStorage: (String(describing: HTTPCookieStorage.shared.cookies))) if let cookies = HTTPCookieStorage.shared.cookies { let sem = DispatchGroup() for cookie in cookies { sem.enter() store.setCookie(cookie, completionHandler: { sem.leave() }) } sem.notify(queue: .main) { completionHandler?() } } else { completionHandler?() } }This used to work just fine until iOS 11.3 Beta. Since then my cookies are not available anymore. I have no clue what to do.Best regardsPeter
Feb ’18
Reply to Setting cookies with WKHTTPCookieStorage do not sync with wkwebview
Hi Peter,Does your code work well with iOS versions before 11.3, (11.3 is still in beta so you might have a solution). Do you insert your cookies before setting the configuration into webview, or does this work even if the configuration is set? Most of our cases scenarios require us to set the cookies to an existent webview and a share WKProcessPool.Regards
Feb ’18
Play Protected Media(Signed Cookies) in AVPlayer?
how to play media with cookies content from the server in AVPlayer(Swift),i have tried but it shows play icon with cross line.func showVideo(url: String){ let videoURL = NSURL(string: url) let cookiesArray = HTTPCookieStorage.shared.cookies!let cookieArrayOptions = [AVURLAssetHTTPCookiesKey: cookiesArray]let assets = AVURLAsset(url: videoURL! as URL, options: cookieArrayOptions)let item = AVPlayerItem(asset: assets)videoPlayer = AVPlayer(playerItem: item)self.playerController.player = self.videoPlayerself.playerController.view.frame = self.view.frameself.present(self.playerController, animated: true, completion: nil)self.playerController.player?.play()}but i am unable to play any media in iOS(Swift) using AVPlayer , we are using AWS Cloudfront to store and retrive media.please correct me or give me proper way to do the same.thanks in advance.
Topic: UI Frameworks SubTopic: AppKit Tags:
0
0
1.3k
Feb ’18
Reply to Authorisation
I'm trying to find solutin how to auto login on Google in my WKWebView … Most web sites uses cookie-based authentication. While the exact mechanics of this vary from site to site, the basic idea is something like this:The site presents a form with a user name and password fieldThe user enters that data and taps Log InThat does an HTTP POST containing the data from the fieldsThe server authenticates based on thatIf it works, the server returns a cookie as part of the responseThe server authenticates subsequent requests based on that cookieEmulating this in general is very hard because:Different sites do it differently, meaning you have lots of site-specific codeThe approach used by any given site is controlled by the site, and they can change it without noticeI want, for example, when i press the buttont o lead me to myaccount page in my webView.Is this for your own personal use? Or for a product that you intend to ship to lots of users?Share and Enjoy — Quinn “The Eskimo!” Apple Developer Re
Feb ’18
Reply to Setting cookies with WKHTTPCookieStorage do not sync with wkwebview
This is rather strange, just out of curiosity how many webviews instances do you have running and also are your WKProcessPools shared or isolated.I found that when i set the cookies before i call load(request) in the wkwebview, the cookies werent updated when decided decidePolicyFor navigationAction: WKNavigationAction is called.At this point the webview is part of the its superview, the configuration is set, and it is using a shared WKProcessPool, i found if i create at this point a new process pool the the cookies are inserted, but sometimes pages dont load correctly...When do you set the cookies, before or after adding it to subview?Apologies for picking your brain, just trying to understand the differences between ur approach and mine, when i finished adding my cookies to WKCookiestorage, if get all cookies i could see them there, but not when i called them at the decidePolicyFor navigationAction: WKNavigationAction method, which is rather strange.To m
Mar ’18
Reply to wkwebview session persistence
Use the same instance of WKProcessPool in all your WKWebViews.Create WKWebViewConfiguration for each WKWebView you instantiate. Update processPool property to WKProcessPool instance.Set cookies to webView.configuration.websiteDataStore.httpCookieStore. Then load your url.
Topic: Safari & Web SubTopic: General Tags:
Mar ’18
SFSafariViewController is rendering cache once after login been succesful
Hi all, Had implemented oAuth login in to my iOS app in which the login page is rendered in SFSafariViewContoller.For the first time,once i login i can able to login and using redirect uri i can redirect to my app.From the second time,i can able to see login page but cant able to login and redirect to my app unless and until i clear my History and website data.Had tried clearing cookies programatically,tried giving no-cache as header value for the authorization request and relaunched my app.Nothing had worked for me.Kindly help me on this in order to solve this issue.Thanx,Venkat
1
0
1.5k
Mar ’18
Log-in credentials of the app are ignored
Hi friends, I have developed a semi native and webapp for the past 3 years now. With the recent iOSupdates the logincredentials are not safed from my users and they are being logged out constantly. Even when all the safari privacysettings are in favor for cookies. What to do? Is there a solution since the recent updates?My users have to sign in every time they open the app. Of course this is not user friendly. Not all users experience this yet. So it is also unclear why some do not experince this problem and some do experience this problem. Is my problem clear to you? Please advise.Thank you very much!Janine
1
0
400
Mar ’18
Reply to Setting cookies with WKHTTPCookieStorage do not sync with wkwebview
I'm having an identical issue. I have seent the same cookie behavior as described above. Cookies report as being in the WHHTTPCookieStore and I wait for the callbacks to finish, but the WKWebView (process pool?) doesn't seem to have them 100% of the time when the request is made.I see random success, indicated a race condition, or in other words, likely a process pool cookie sync scheduling issue
Mar ’18