steam_totp

package module
v0.0.0-...-18e9286 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2017 License: MIT Imports: 6 Imported by: 0

README

Go Steam TOTP

Build Status Coverage Status license

This package generates Steam-style 5-digit alphanumeric two-factor authentication codes given a shared secret.

Installation

$ go get github.com/fortis/go-steam-totp

Usage

Generate 5-digit code to Log on Steam

package main

import (
        "log"
        "github.com/fortis/go-steam-totp"
)

func main() {
    var sharedsecret = "cnOgv/KdpLoP6Nbh0GMkXkPXALQ="
    code, _ := steam_totp.GenerateAuthCode(sharedsecret, time.Now())
    log.Println(code)
}

Documentation

Documentation is hosted at GoDoc project.

Acknowledgments

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Documentation

Overview

Package to generate Steam-style TOTP auth codes

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidSharedSecret = errors.New("invalid base64 shared secret")

ErrInvalidSharedSecret can be returned when shared secret isn't base64 encoded string.

Functions

func GenerateAuthCode

func GenerateAuthCode(sharedSecret string, t time.Time) (string, error)

GenerateAuthCode generate and returns 5 symbols authentication code. Shared Secret must be valid base64 string otherwise error will be returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL