No commit activity in last 3 years
No release in over 3 years
Ruby implementation of the Battle.net Mobile Authenticator
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Bnet::Authenticator

Ruby implementation of the Battle.net Mobile Authenticator.

Gem Version Dependency Status

Build Status

Coverage Status

Code Climate Coverage Status from Code Climate

FYI: Badge images provided by http://shields.io/

Installation

$ [sudo] gem install bnet-authenticator

Using the library

>> require 'bnet/authenticator'

Request a new authenticator

>> authenticator = Bnet::Authenticator.request_authenticator(:US)
=> {:serial=>"US-1405-0242-3258", :secret=>"778275450e5c3e092bc4fe901cd7c11241166c88", :restorecode=>"0WCRH9Z926", :region=>:US}

Get a token

>> authenticator.get_token
=> ["38530888", 1399038930]

Restore an authenticator from server

>> Bnet::Authenticator.restore_authenticator('CN-1402-1943-1283', '4CKBN08QEB')
=> {:serial=>"CN-1402-1943-1283", :secret=>"4202aa2182640745d8a807e0fe7e34b30c1edb23", :restorecode=>"4CKBN08QEB", :region=>:CN}

Initialize an authenticator with given serial and secret

>> Bnet::Authenticator.new('CN-1402-1943-1283', '4202aa2182640745d8a807e0fe7e34b30c1edb23')
=> {:serial=>"CN-1402-1943-1283", :secret=>"4202aa2182640745d8a807e0fe7e34b30c1edb23", :restorecode=>"4CKBN08QEB", :region=>:CN}

Using the command-line tool

Run bna and follow instructions.