Class SpellscrollTokenStore

java.lang.Object
app.spellscroll.auth.SpellscrollTokenStore

public class SpellscrollTokenStore extends Object
Persists the OAuth2 refresh token in the OS native credential store (Windows Credential Manager, macOS Keychain, or libsecret on Linux) via com.microsoft:credential-secure-storage.

Only the refresh token is stored — it is the only long-lived secret. Access tokens are obtained fresh each Gradle run by exchanging the refresh token, so they never touch disk.

If no secure backend is available the store will be null and load() returns null, forcing a fresh interactive login each run.

  • Constructor Details

    • SpellscrollTokenStore

      public SpellscrollTokenStore()
  • Method Details

    • save

      public void save(String refreshToken)
      Saves refreshToken to the OS credential store.
    • load

      public String load()
      Returns the stored refresh token, or null if none is saved or the store is unavailable.
    • clear

      public void clear()
      Removes the stored refresh token (e.g. after a 401 from the server).