question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to check if a password is stored in keychain

See original GitHub issue

I 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:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
DarkHollowcommented, May 10, 2017

So you can close this! =)

1reaction
vonovakcommented, Mar 10, 2017

hi! your way is the way to do it. You can wrap that as a function and return 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.? update- see below

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found