Hi,
I have a SAML authentication scenario with MFA(probably Okta) in my app that runs in WKWebView using Cordova. I am currently doing POC to authenticate PIV certificates(either one of the 3 Issuers: DISA Purebred, Intercede and Entrust) in WKWebView with Cordova.
As if now, I have found that WKNavigationDelegate method: didReceive challenge, we can authenticate the certificate. Also, these PIV certificates which are stored in the form of .p12 in Apple's keychain group needs to be imported using function: SecPKCS12Import.
Please let me know if my understanding is correct or if there are any implementation challenges in WKWebView with Cordova. I would highly appreciate if any information regarding this can be provided.
So a .p12
file usually contains a digital identity, that is, a certificate and the private key that matches the public key in that certificate. I’d be very surprised if your PIV hardware let you export the private key to a .p12
. That’d be most weird. So I’m not entirely sure how PVI fits into this.
Regardless, you wrote:
I am aware that this PIV digital certificate will be stored in iOS device through
Via a com.apple.security.pkcs12
payload?
If so, your app can’t access that directly. We talk about that limitation in QA1745 Making Certificates and Keys Available To Your App.
OTOH, if your system uses PIV the way it’s meant to be used — where the private key resides on PIV hardware that’s in the user’s possession — thenh that’s something you can access from your app. I talk about the general process for this in here.
IMPORTANT If you want to use the digital identity to handle server trust authentication challenges (NSURLAuthenticationMethodClientCertificate
) in a web view, you can stop after the first step, calling SecItemCopyMatching
to get the digital identity (kSecClassIdentity
). Use that digital identity to create a credential with which to resolve the challenge.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"