objective c - Connect to VPN ios8, persistent reference of password from keychain is null -
I am trying to add VPNs using the Network Extensions Framework, but there are some issues, while in the keychain There is a constant reference to stored passwords. This [ But when I use the NEVPNManager class object to store password reference, why not find any details? And whenever I try to connect to VPN instead of getting the keypain, I get a signal to enter a password? Here is the code: PS: Everything works well except this issue. Before you can change them, you have to load the preferences. Make sure to run the LoadFrom Context FinishHandler and then create your own protocol and then Make your updates. NSLog (@ "Password:% @", [Manager Protocol]. Password Reference); ] Returns blank returns after calling
[manager saveToPreferencesWithCompletionHandler: ^ (NSError * error) {.. ..} But when I try to log in before saving I have completed the correction. Gives me a valid reference in the keychain. When I use this code block, for that continuous reference I get all the details stored in the keychain.
NSDictionary * query = @ {(__bridge id) kSecValuePersistentRef: (__Bridge NSData *) (KeychainUserPass passwordPrescent Reference), (__Bridge ID) KSCRReturnsEventives: (ID) KCBolientrate}; Cfafstaff passworddict = zero; Ossetatus Status = Seam Etymcopy Matching ((__ Bridge CFFFFF) Query, (CFTPREF *) and PasswordDict); NSLog (@ "Status:% ld, Password:% @", Status, (__bridge NSDictionary *) passwordDict); NSLog (@ "Keychain Password:% @", P. Powered Reference);
NEVPNProtocolIKEv2 * p = [[NEVPNProtocolIKEv2 alloc] in this]; P.username = @ "Username"; P.passwordReference = (__breeze NSDITA *) (key chain uspass. Password workstation reference); P.serverAddress = @ "Hostname"; P.authenticationMethod = NEVPNIKEAuthenticationMethodCertificate; P.serverCertificateIssuerCommonName = @ "The name of the certificate issuer"; P.serverCertificateCommonName = @ "Certificate Name"; P.identityData = // p12; P.identityDataPassword = @ "Password for p12"; P.localIdentifier = @ "Local Identifier"; P.remoteIdentifier = "Remote Identifier"; P.useExtendedAuthentication = Yes; P.disconnectOnSleep = No; [Manager Set Protocol: P]; [Manager SetOndemed is Enabled: Yes]; [Manager Sitocolized Description: @ "VPN Profile" ]; [Manager saveToPreferencesWithCompletionHandler: ^ (NSError * error) {if (error) {NSLog (@ "Save error:% @", error);} and {NSLog (@ "saved!"); NSLog (@ " Enabled:% d ", [Manager enabled handmade]); NSLog (@" On Demand Rules:% @ ", [Manager on Dema NSLog (@ "Username:% @", [Manager Protocol]. Username); NSLog (@ "Password:% @", [Manager Protocol]. Password Reference);}}];}
Comments
Post a Comment