Mac OS X Keychain access in Java for Generic Passwords

前端 未结 5 1047
[愿得一人]
[愿得一人] 2020-12-30 15:51

What is the standard way to retrieve generic passwords in the Keychain of OS X using only Java? Apple Developer Pages provide some good background but the implementation and

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-30 16:45

    I've done this myself by using the command line, e.g. running /usr/bin/security. However it doesn't have strong access controls. So you can run the /usr/bin/security from a terminal to access the same passwords, but a C++ app calling into the library directly would be blocked.

    Because of this I'm using it only for oauth tokens for Social Media accounts. Things that you could do similarly by launching a web browser when logged in as the user.

    https://github.com/yschimke/oksocial/blob/master/src/main/java/com/baulsupp/oksocial/credentials/OSXCredentialsStore.java

提交回复
热议问题