okta / samples-ios

samples-ios
https://github.com/okta/samples-ios
Apache License 2.0
38 stars 28 forks source link

YubiKey factor throwing error in OktaNativeLogin. #82

Closed Mohitkiran closed 4 years ago

Mohitkiran commented 4 years ago

Hi,

I am trying to use OktaNativeLogin Yubikey factor in the simulator and this is throwing me an error when I click on token:hardware and the error is Yubikey is not recognized in the system, please try again or contact your administrator. but I am able to login to okta using Yubikey from browser. I checked console for logs and this is what I have found

Console Logs: Log 1: failed to create token in slot Yubico Yubikey 4 OTP+U2F+CCID (AID:<a0000003 08000010 000100>, error:Error Domain=CryptoTokenKit Code=-6 "(null)")

Log 2: com.apple.CryptoTokenKit.pivtoken cannot handle token in slot Yubico Yubikey 4 OTP+U2F+CCID, error:Error Domain=CryptoTokenKit Code=-7 "(null)" UserInfo={NSUnderlyingError=0x7feaaae00cf0 {Error Domain=CryptoTokenKit Code=-6 "(null)"}}

Screenshot 2020-05-31 at 11 30 51 AM

Environment: macOS: Mojave 10.14.5 (18F132) Xcode: 11.2.1 (11B500) Simulator: 11.2.1 (SimulatorApp-912.4 SimulatorKit-570.3 CoreSimulator-681.15) YubiKey: Yubikey 5 NFC

Can someone help me out?

Thank you.

IldarAbdullin-okta commented 4 years ago

Hi @Mohitkiran ,

This sample app demonstrates handling of basic factors - sms, call, push and totp. So I assume you need to do extra work on app side to make it work. So something like: get token from NFC interface and call verify function with that token

Ildar

IldarAbdullin-okta commented 4 years ago

So I would assume you will need to integrate with YubiKey iOS SDK - https://developers.yubico.com/Mobile/iOS/