This repository was archived by the owner on Oct 26, 2022. It is now read-only.

Description
I have seen that there is some integration only with the Os X keyring, perhaps using a library can help a lot.
Using Scala + sbt to write seamlessly integrated OSX Apps has a section explaining the use of the Netbeans keyring module (cited from the site):
It consists of two parts: A platform-independent API and implementations of this API for all major operating systems. Currently there are implementations for OSX, Windows, KDE, Gnome, SPI and a fallback using a Java keystore. We start by adding all of that to our build.sbt:
libraryDependencies ++= Seq(
"org.netbeans.api" % "org-netbeans-modules-keyring" % "RELEASE721",
"org.netbeans.modules" % "org-netbeans-modules-keyring-impl" % "RELEASE721"
)
resolvers += "netbeans" at "http://bits.netbeans.org/maven2/"
Usage is straightforward, once you know that the keyring only stores char arrays:
private val keyName = "doctivity"
def readToken =
Keyring.read(keyName) match {
case null => None
case chars => Some(chars.mkString)
}
def storeToken(token: String) {
Keyring.save(keyName, token.toCharArray, "access token for doctivity")
}
def deleteToken {
Keyring.delete(keyName)
}