How to check if a password is stored in keychain
See original GitHub issueI would like to check whether a password has already been saved in keychain. Is it possible to do this with the current API?
I’m am currently doing it like this which feels a bit awkward:
try {
//retrieve the credentials from keychain if saved.
let credentials = await Keychain.getGenericPassword()
if (credentials) //do something
else //show error
}
catch(err) {
if(err.message !== 'No keychain entry found') //No password exists in the key chain...
else //some other error occurred.
}
Do you have suggestion how I could check if a keychain entry exists?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
View the information stored in a keychain on Mac
If you want to see the password for an item, click “Show password,” then enter the password for the keychain that contains that...
Read more >How to view iCloud Keychain passwords on iPhone, iPad, and ...
1) Open Safari on Mac and press Command + Comma (,). · 2) Click Passwords from the top and authenticate using Mac's password...
Read more >How to View Passwords Saved in iCloud Keychain on macOS ...
1. Open the Settings app. · 2. Scroll down and tap on “Passwords.” If you have Face ID enabled, your iPhone will authenticate...
Read more >How to Check iCloud Keychain Password Security - MacRumors
Scroll down and tap Passwords. Tap Security Recommendations. Check the list of recommendations under "High Priority." Tap a recommendation for ...
Read more >How Do I See My Passwords in iCloud Keychain?
The easiest way to retrieve the desired username and password in iCloud Keychain is by launching Safari and locating Preferences > Passwords. As...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So you can close this! =)
hi!
your way is the way to do it. You can wrap that as a function andupdate- see belowreturn Promise.resolve(true/false)
based on what you get from Keychain.getGenericPassword(). I’m guessing that could be a function to have out of the box, if you do a PR for that maybe @oblador would merge it.?