docs » Token

generate google authenticator token value keystrokes Retrieve a google authenticator token seed from keychain and use this to calculate the current value Simulate keystrokes for this token value

written by Teun Vink github@teun.tv, converted to spoon by Tyler Thrailkill <snowe>

https://github.com/teunvink/hammerspoon

API Overview

API Documentation

Variables

logger
Signature Token.logger
Type Variable
Description Logger object used within the Spoon. Can be accessed to set the default log level for the messages coming from the Spoon.
Source Source/Token.spoon/init.lua line 20
secret_key
Signature Token.secret_key
Type Variable
Description String indicating the Keychain name of the Shared Key used in the OTP HMAC-SHA1 generation
Source Source/Token.spoon/init.lua line 25

Methods

bindHotkeys
Signature Token:bindHotkeys(mapping)
Type Method
Description Binds hotkeys for Token
Parameters
  • mapping - A table containing hotkey modifier/key details for the following items:
    • generate - generate and type token
Returns
Source Source/Token.spoon/init.lua line 77
get_token
Signature Token:get_token()
Type Method
Description Retrieves the token using an HOTP/TOTP Secret Key stored in the keychain
Parameters
  • None
Returns
Source Source/Token.spoon/init.lua line 65
token_keystroke
Signature Token:token_keystroke()
Type Method
Description read a token secret key from keychain, generate a code and make keystrokes for it
Parameters
  • None
Returns
Source Source/Token.spoon/init.lua line 53