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://***.yyy.edu"];
NSString *callbackUrlScheme = @"https://***.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", started ? "TRUE":"FALSE");
}
@end
In Capibilities, I have
- Associated Domains: ON -- webcredentials:*.yyy.edu
- AutoFill Credential Provider: ON
When the app is executed, it first prompts for permissions to access for shared data; see - https://pasteboard.co/IvCEiu5.png. Then web page prompts for login; see - https://pasteboard.co/IvCFa9v.png . At this point I thought autofill will start using login/password specified but it prompts everytime for login/password instead of autofilling.
What am I doing wrong?
[PS: My last post didn't take so posting again]