Giter VIP home page Giter VIP logo

google-authenticator-exporter's Introduction

google-authenticator-exporter's People

Contributors

benhaney avatar deepdesai003 avatar dependabot[bot] avatar georgeyord avatar krissrex avatar nathan-fourrier avatar trulsstenrud avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

google-authenticator-exporter's Issues

Error saving to file

Hi, great script! really helpful.
Not a major issue but I am having issues when trying to save to file


`prompt: saveToFile:  y
prompt: filename:  lee.json
lee.json
true
Saving to "lee.json"...
node:internal/readline/emitKeypressEvents:71
            throw err;
            ^

TypeError: saveToFile is not a function
    at toJson (D:\py\gauth\src\index.js:120:5)
    at D:\py\gauth\src\index.js:181:9
    at D:\py\gauth\node_modules\prompt\lib\prompt.js:357:32
    at D:\py\gauth\node_modules\async\lib\async.js:154:25
    at assembler (D:\py\gauth\node_modules\prompt\lib\prompt.js:354:9)
    at D:\py\gauth\node_modules\prompt\lib\prompt.js:363:32
    at D:\py\gauth\node_modules\prompt\lib\prompt.js:658:5
    at Interface.onLine (D:\py\gauth\node_modules\read\lib\read.js:111:5)
    at Interface.emit (node:events:390:28)
    at Interface._onLine (node:readline:487:10)`

Convert to standalone website

This could be turned into a static website, if the dependencies (protobufjs) allow for it.
The prompt and colors are only needed in the CLI.

RangeError: index out of range:

node:readline:1252
throw err;
^

RangeError: index out of range: 51 + 10 > 51
at indexOutOfRange (C:\Users\test\google-authenticator-exporter\node_modules\protobufjs\src\reader.js:13:12)
at BufferReader.read_uint32 [as uint32] (C:\Users\test\google-authenticator-exporter\node_modules\protobufjs\src\reader.js:98:19)
at BufferReader.read_int32 [as int32] (C:\Users\test\google-authenticator-exporter\node_modules\protobufjs\src\reader.js:109:17)
at Type.OtpParameters$decode [as decode] (eval at Codegen (C:\Users\test\google-authenticator-exporter\node_modules@protobufjs\codegen\index.js:50:33), :23:14)
at Type.decode_setup [as decode] (C:\Users\test\google-authenticator-exporter\node_modules\protobufjs\src\type.js:507:25)
at Type.MigrationPayload$decode [as decode] (eval at Codegen (C:\Users\test\google-authenticator-exporter\node_modules@protobufjs\codegen\index.js:50:33), :13:33)
at Type.decode_setup [as decode] (C:\Users\test\google-authenticator-exporter\node_modules\protobufjs\src\type.js:507:25)
at decodeProtobuf (C:\Users\test\google-authenticator-exporter\src\index.js:14:36)
at decode (C:\Users\test\google-authenticator-exporter\src\index.js:48:19)
at C:\Users\test\google-authenticator-exporter\src\index.js:176:22

Module index.js not found

I was just testing the code when i stumbled upon an 'error'.
It occurs whenever i try to run 'npm run start' or 'npm run start:qrcode'

npm and Nodejs are installed. and the index.js file exists in the stated location...

Am i doing something wrong/missing something, or what could be the problem here?

** Enviroment **
Debian 12 Virtual Machine running in Virtual Box

** Error Message **

npm run start

[email protected] start
node ./src/index.js

node:internal/modules/cjs/loader:1042
throw err;
^

Error: Cannot find module 'prompt'
Require stack:

  • /home/vm-admin/Downloads/google-authenticator-exporter-master/src/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1039:15)
    at Module._load (node:internal/modules/cjs/loader:885:27)
    at Module.require (node:internal/modules/cjs/loader:1105:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at promptUserForUri (/home/vm-admin/Downloads/google-authenticator-exporter-master/src/index.js:136:18)
    at Object. (/home/vm-admin/Downloads/google-authenticator-exporter-master/src/index.js:190:1)
    at Module._compile (node:internal/modules/cjs/loader:1218:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
    at Module.load (node:internal/modules/cjs/loader:1081:32)
    at Module._load (node:internal/modules/cjs/loader:922:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/home/vm-admin/Downloads/google-authenticator-exporter-master/src/index.js'
    ]
    }

Node.js v18.13.0

only works with a single QR Code export

Might be worth mentioning in the REAMDE that the QR code presented by Google Auth must not be more than one.

In case it is more than one the workaround is to limit the amount of exported accounts

Implement QR code parsing

A user can upload/select a jpg, and we then read QR and get the URI from it.
I know this can be done in python, but the aim is to run 100% client side to be compatible with #1.

An even more viable option is to implement #1, then use the webcamera from the browser to read the Google Authenticator QR code. This simplifies the process a lot.

error writing qrcodes

Also found an issue with generating QRCodes due to non-escaped characters.
e.g.for windows /:*?"<>|
I often find these are used in the authenticator name

I changed lines 91-94 of index.js to the below (probably a MUCH better way of doing it than this,but it worked for me (windows) today ;-)

const Escname = name.replace(/[\\\/:*?"<>|]/g, "\-")

    const url = `otpauth://totp/${encodeURI(name)}?secret=${encodeURI(secret)}&issuer=${encodeURI(issuer)}`
    const file = `${directory}/${issuer || "No issuer"} (${escname}).png` 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.