6 Replies
      Latest reply: Sep 28, 2016 6:33 AM by Mariano Abdala RSS
      Laclass19 Level 1 Level 1 (0 points)

        I was using it to auto login and since that update it does not work. And how a waste of time to check the debugg consloe with all these useless informations!!

        • Re: Why does NSURLCredentialStorage no longer works since the update to xcode 8??
          eskimo Apple Staff Apple Staff (6,765 points)

          Why does NSURLCredentialStorage no longer works since the update to xcode 8??

          It’s impossible to answer this without more information about what you’re trying to do with this class.  To start, what platform are you on?

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"

          • Re: Why does NSURLCredentialStorage no longer works since the update to xcode 8??
            Laclass19 Level 1 Level 1 (0 points)

            Hi. And sorry for the lack of infos.

            So, i am coding for ios using objective C.

            I am using this class to log in and out while saveing the credentials to autologin the user when he did not log out.

            Here is the  snipets for you to have an idea.

            On the log in, it seems working but when i exit the viewcontroller and come back, the credentials should be checked and applied.

            //LOG IN//
            
            
            NSURLProtectionSpace *loginProtectionSpace = [[NSURLProtectionSpace alloc]
                                                                 initWithHost:@"https:XXX.com"
                                                                 port: 443
                                                                 protocol:NSURLProtectionSpaceHTTP
                                                                 realm:nil
                                                                 authenticationMethod:NSURLAuthenticationMethodDefault];
                   
                     NSURLCredential *credential = [NSURLCredential credentialWithUser:_userNameLogInPlayFab.text password:_passwordLoginPlayFab.text persistence:NSURLCredentialPersistencePermanent];
                   
                     [[NSURLCredentialStorage sharedCredentialStorage] setCredential:credential forProtectionSpace:loginProtectionSpace];
                     NSLog(@"User connected:%@ with password:%@", credential.user, credential.password);
                   
            

            The log out crashes the app and highlights these lines when before the update, it was working perfectly.

             //LOG OUT// 
            
            
            [[NSURLCredentialStorage sharedCredentialStorage] removeCredential:credential forProtectionSpace:loginProtectionSpace];
                NSLog(@"Credential removed.");