Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.
/ autoauth Public archive

Automatic Internet Portal Authentication CLI written in Go πŸ›°πŸ›°

License

Notifications You must be signed in to change notification settings

PePoDev/autoauth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

97 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AutoAuth

Banner

Go Report Card GoDoc codebeat badge GolangCI fuzzit Build Status codecov Sourcegraph GitHub tag Docker Repository GitHub

AutoAuth is Automatic Internet Portal Authentication CLI written in Golang πŸ›°πŸ›°

πŸ“š Table of contents

⛏ Installation

Go get

~$ go get -u github.com/pepodev/autoauth

Docker

~$ docker run --name autoauth -d -v ${pwd}/autoauth.yml:/autoauth.yml pepodev/autoauth

Note: docker network need ability to access external internet

Complied binary (coming soon too)

Check release page to see available binary file.

πŸ“ƒ Example Preset file

# Example preset file for university KMITL wifi portal
autoauth:
  name: KMITL
  encrypted: false

  login:
    endpoint: https://connect.kmitl.ac.th:8445/PortalServer/Webauth/webAuthAction!login.action
    method: POST
    header:
      - User-Agent:AutoAuth
    body:
      - userName=59050xxx@kmitl.ac.th
      - password=s3cr3t_p@ssw0rd
      - authLan=en
      - validCode=200
      - hasValidateNextUpdatePassword=true
      - browserFlag=en
    timeout: 5

  logout:
    endpoint: https://connect.kmitl.ac.th:8445/PortalServer/Webauth/webAuthAction!logout.action
    method: POST
    header:
      - User-Agent:AutoAuth
      - X-XSRF-TOKEN:{token}
    timeout: 5

  heartbeat:
    endpoint: http://clients3.google.com/generate_204 # Recommended endpoint for heartbeat
    method: GET
    header:
      - User-Agent:AutoAuth
    interval: 5
    timeout: 5
    retry: 3

  save:
    - token

Note: The config also support in various format include json, toml, hcl, envfile. It's powered by Viper

πŸ“• CLI Usage

Basic usage run this command to Start Autoauth

~$ autoauth start -f ./autoauth.yml

Or use Help command to see, What's Autoauth CLI can do for you.

~$ autoauth --help

Help Command

πŸ“ Todo

  • Add docker image

  • Add complied binary file

  • Save key from response for use in another purpose

  • Add retries rule

  • Create preset file from CLI

  • Decrypt with key for read secret variables from preset file

  • Implement timeout from preset file

  • Write unit tests

  • Write benchmark

  • Write documents

  • Create GUI

πŸ›’ Dependencies

  • Cobra A Commander for modern Go CLI interactions

  • Viper Go configuration with fangs

  • Fasthttp Used for httpclient. Zero memory allocations. Up to 10x faster than net/http

  • Go-ps Find, list, and inspect processes from Go (golang).

πŸ•΅οΈβ€β™€οΈ Contributing

Yes, Thanks for all contributor.

If you have any question or issues also check this page.