iOS: How to authenticate a user after login (for auto login)?

前端 未结 4 1388
醉酒成梦
醉酒成梦 2021-02-03 11:16

I\'d like to use an auto-login function. So when the user opens the app, he gets delegated to a \"login screen\". When he logged in successfully he should be directed to his acc

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-03 12:15

    To answer the question: if you want to auto-login with keychain data, use the free framework "SFHFKeychainUtils". It saves username, password and servicename in keychain. if you want to retrieve it, just save the username in NSUserDefaults and you can get the password with ease.

    Here we go:

    SiFi HiFi Framework: https://github.com/ldandersen/scifihifi-iphone/tree/master/security

    SiFi Hifi Framework (ARC compatible): https://stackoverflow.com/a/10348964/1011125

    How to use SFHFKeychainUtils: http://gorgando.com/blog/technology/iphone_development/simple-iphone-tutorial-password-management-using-the-keychain-by-using-sfhfkeychainutils

提交回复
热议问题