Search results for

ASWebAuthenticationSession cookie

1,295 results found

Post

Replies

Boosts

Views

Activity

ASWebAuthenticationSession does not prompt to store credentials
Hello, I'm implementing ASWebAuthenticationSession to make a sign in. ASWebAuthenticationSession it uses SFSafariViewController to display the sign in URL, but after make the sign in, there is no prompt to ask to the user to store their credentials. Using directly SFSafariViewController this prompt appears. Even the suggestion to change the password to one stronger. Is this issue happening to someone else? Thank you very much
6
0
873
Aug ’20
ASWebAuthenticationSession Async/Await API
Is there any particular reason why ASWebAuthenticationSession doesn't have support for async/await? (example below) do { let callbackURL = try await webAuthSession.start() } catch { // handle error } I'm curious if this style of integration doesn't exist for architectural reasons? Or is the legacy completion handler style preserved in order to prevent existing integrations from breaking?
1
0
453
Oct ’24
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
ASWebAuthenticationSession and autofill Login/Password
Hello,I have an app that views a web page. This web page requires login. So, I decided to use ASWebAuthenticationSession to autofill web page with credentials. Needless to say it is not working. Here is my code;#import ViewController.h #import @interface ViewController () @property (strong) ASWebAuthenticationSession *session; @end @implementation ViewController @synthesize session; - (void)viewDidLoad { [super viewDidLoad]; } - (IBAction)loginBtnClicked:(id)sender { NSURL *destinationUrl = [NSURL URLWithString:@https://xxx.yyy.edu]; NSString *callbackUrlScheme = @https://xxx.yyy.edu/Pages/main.aspx; session = [[ASWebAuthenticationSession alloc] initWithURL:destinationUrl callbackURLScheme:callbackUrlScheme completionHandler:^(NSURL * _Nullable callbackURL, NSError * _Nullable error) { if (error != nil && error.code == 1){ [self.session cancel]; } else { printf(Error: %s, error.localizedDescription.UTF8String); } }]; BOOL started = [session start]; printf(Started? %s, starte
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
778
Sep ’19
ASWebAuthenticationSession not working in Preview
class ViewModel : NSObject, ObservableObject, ASWebAuthenticationPresentationContextProviding { private var authSession: ASWebAuthenticationSession? func signInWithOpenID(provider: OAuthProvider) { let url = getOIDCAuthenticationURL(provider: provider) authSession?.cancel() authSession = nil authSession = ASWebAuthenticationSession(url: url, callbackURLScheme: com.ninjanutri) { callbackURL, error in if let error = error { print(Error: (error.localizedDescription)) return } guard let callbackURL = callbackURL else { return } guard let idToken = callbackURL.valueOf(id_token) else { return } self.signInWithIdToken(provider: provider, idToken: idToken) } authSession?.prefersEphemeralWebBrowserSession = false authSession?.presentationContextProvider = self authSession?.start() } public func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor { return ASPresentationAnchor() } } struct ContentView: View { @StateObject private var viewModel = ViewModel() v
1
0
459
Dec ’24
Duplicate cookie in NSHTTPCookieStorage
We are experience a weird problem in our App where NSHTTPCookieStorage has duplicate entry for certain cookies. This is after upgrading to iOS 9.1.Cookie accept policy didn't change, its always been NSHTTPCookieAcceptPolicyAlwaysSteps to reproduce:iOS 9.0.2 install app. Load URL request(s), response headers have set cookie which creates cookie in cookie storage (Automatically done by NSURLConnection) print all cookies. * At this time we observe that we have just one entry for each Cookie name.Upgrade to 9.1 Open the app Load URL request(s), response headers have set cookie which creates cookie in cookie storage (Automatically done by NSURLConnection) Print all cookies. * This is where we observe two entries for each Cookie name.Cookie name: SameCookie domain: SameCookie Path: SameCookie Expiration: Valid
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
1.3k
Oct ’15
ASWebAuthenticationSession autofill login/password
Hi, I want use ASWebAuthenticationSession to autofill login/password on a website. I tried some code but it doesn't work it always prompt me for password. First I goto webSITE from button click action and then get the permissions prompt;https://pasteboard.co/IvzRXGZ.pngThen, after clicking continue button, the website prompts me for password;https://pasteboard.co/IvzSJjs.pngI fill in my username and password.Now, next time I go to page it SHOULD autofill with the login and password I entered. Its asking for login and password instead!Here is code excerpt;#import ViewController.h #import <AuthenticationServices/AuthenticationServices.h> @interface ViewController () @property (strong) ASWebAuthenticationSession *session; @end @implementation ViewController @synthesize session; - (void)viewDidLoad { [super viewDidLoad]; } - (IBAction)loginBtnClicked:(id)sender { NSURL *destinationUrl = [NSURL URLWithString:@https://site.name.edu]; NSString *callbackUrlScheme = @https://site.name.edu/Pages
Topic: UI Frameworks SubTopic: UIKit Tags:
2
0
1.2k
Sep ’19
WKWebview and cookie
WKWebviewで表示しているウェブページでhtmlまたはjavascript、javaで作成されたcookieを取得することは可能でしょうか?cookieがWebviewの外で作成されていると思うのですが、その場合のcookieの取得方法を教えてください。サンプルコードがあれば教えてください。
0
0
704
Mar ’16
Cookies always empty
HiI am using a WKWebView and the site is working. Now I need access to cookies that are being set. I found some code, but the cookies are always coming up with a count of 0. When I connect using Safari-WebInspector I am able wo see that the cookies are actually there. Help! let cookieManager = NSHTTPCookieStorage.sharedHTTPCookieStorage() cookieManager.cookieAcceptPolicy = NSHTTPCookieAcceptPolicy.Always cookieStore = cookieManager.cookies! logger.log(cookies: + cookieStore.description);output: cookies: []I am seing that they show Expire Date of December 31 2000 in WebInspector, but when I connect via computer they show only Session for expiration. Do I need to alter the site javascript and change the cookie expiration somehow?
Topic: UI Frameworks SubTopic: AppKit Tags:
1
0
1.1k
Oct ’15
WKWebView cookies management
Problem statement- WKWebView cookies management. We need to clone the connection used by the WKWebView to the same end point, this connection utilize cookies for routing and missing even one the cookies will end up with a wrong route to be used. It appears that when retrieving the cookies from the WKWebView connection some cookies are missing. From some analysis seems that the missing cookies all have in common a value containing special characters. The question for Apple is if they are going to relax the constraint on cookies value to allow such cookies to be used. Technical Description:- We are using WKWebView. There are some cookies being set during server connection. We are retrieving all cookies using 'getAllCookies' method of WKWebview. Sometime its not giving correct set of cookies in case if there are any special characters in any cookie. For example - Cookie- ss2QKagAdkAV3My1pnKElaFDnQ
1
0
708
Mar ’24
How to get Password AutoFill to work with ASWebAuthenticationSession?
I have a sample HTML form that follows the password auto-fill requirements. When navigating to the web page without the app, using the built-in Safari app, the native Password AutoFill dialogs for the login and signup forms correctly show:However, when viewed within the app, the same flow does not trigger the dialog in neither the login or signup submission. It simply dismisses the login/signup screen without any error.This is how my view controller looks like:class ViewController: UIViewController { @IBAction func didTapLoginButton() { let session = ASWebAuthenticationSession( url: URL(string: https://example.com/login.html)!, callbackURLScheme: customscheme) { print($0, $1) } session.prefersEphemeralWebBrowserSession = true session.presentationContextProvider = self session.start() } } extension ViewController: ASWebAuthenticationPresentationContextProviding { func presentationAnchor(for session: ASWebAuthenticationSession) -&gt; ASPresentationAnchor { view.window! } }Is there a way to
5
0
2.4k
May ’20