Broken HTTP basic authentication in web apps on iOS 7?
Asked Answered
M

4

7

I'm using basic authentication for a simple app but it stopped working in web app mode on iOS 7. It works in Safari, it worked on iOS 6 both in Safari and as a standalone web app, but after migrating to iOS 7 it shows only white screen.

Did anyone experience the same problem?

Mablemabry answered 24/9, 2013 at 8:22 Comment(0)
T
1

I found that by removing windows auth from iis, and leaving only basic with the realm set to the domain solved this issue for me.

Give that a try.

Theorize answered 4/10, 2013 at 8:34 Comment(0)
U
1

I think this may be related to the dialog problem described here.

Standard dialogs are not working at all, such as alert, confirm or prompt.

The login prompt that is shown to authenticate the user is probably blocked (does not work or is not visible) and that is why the web app does not pass through the authentication phase.

I suppose Apple will have to fix this bug in a future release.

Edit: After upgrading to iOS 7.0.3 basic authentication suddenly started to work again also in home screen web app mode. Login prompt is displayed and everything works as expected.

Undershrub answered 4/10, 2013 at 15:34 Comment(0)
I
1

This worked for me.

+ (void) setBasicAuth
{
  NSURLCredentialStorage* store = 
    [NSURLCredentialStorage sharedCredentialStorage];

  NSURLCredential* creds = 
    [NSURLCredential credentialWithUser:@"user" 
                               password:@"pass"
                            persistence:NSURLCredentialPersistenceForSession];

  NSURLProtectionSpace* protectionSpace = 
    [[NSURLProtectionSpace alloc] initWithHost:@"your-host" 
                                          port:80 
                                      protocol:@"http" 
                                         realm:@"Your Realm"
                          authenticationMethod:NSURLAuthenticationMethodDefault];

  [store setCredential:creds forProtectionSpace:protectionSpace];
}
Intelligibility answered 21/2, 2014 at 7:58 Comment(0)
T
0

I‘m experiencing the exact same problem. It works when putting username and password in the url of your web app and

Thermostatics answered 2/10, 2013 at 9:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.