I am having trouble implement this.
Theres a UIwebview that holds a site which required to login. I first created a login modal page for the user to login, and this part is DONE.
I used the code from here: How to display the Authentication Challenge in UIWebView?
Now, once the user logged in, he/she is sitting inside the secured mobile site. But there are some links in the mobile site which requires to login again.
Right now I am doing it in a hacky way, in the method of:
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType;
I check and see if the request.url is equal to "https://www.#$%^&.com", if yes, then i will set _authed = NO, and basically do the login process again.
It works fine, but if there are 100+ of links that required to logins again, I will have to add 100+ of url to my if-statement, in order to catch it.
I am hoping someone can help me figure out a better way to implement this.