Skip to content

Latest commit

 

History

History
126 lines (92 loc) · 2.23 KB

README.md

File metadata and controls

126 lines (92 loc) · 2.23 KB

Slippi Auth

An (unoffical) authenticator for slippi accounts.

How does it work

Slippi-auth is a service that provides authentication using a slippi account. It works by faking a netplay player which the person wanting to authentify has to connect to in direct mode.

Warning

Because the traffic is not encrypted between the slippi servers and slippi-auth, if an attacker gains privilege on the network of your sever he can authentify as anyone. I would therefore not use this auth for sensible data.

Installation

  1. Clone the repo:
git clone https://github.com/ananas-dev/slippi-auth
cd slippi-auth
  1. Create accounts that will be used by the authenticator, you'll need to grab their uids and play keys found in their user.json then put them in a file called clients.json in the slippi-auth directory:
[
  {
    "uid": "redacted",
    "playKey": "redacted",
    "connectCode": "XYZ#111"
  },
  {
    "uid": "redacted",
    "playKey": "redacted",
    "connectCode": "XYZ#222"
  }
]
  1. Install ENET:
  • Windows: Nothing to do.

  • Debian Based Linux:

apt install libenet-dev
  • Mac:
brew install enet
  1. Run the service:
go run cmd/slippi-auth/main.go

Usage

Slippi-auth starts a websocket server on 0.0.0.0:9002 you can then communicate with it using this workflow:

Queue an user

First you have to send the connected code of the user you want to authenticate and the timeout in ms.

{
    "type": "queue",
    "code": "XXX#123",
    "timeout": 60000
}

Receive the auth connect code

When the server will start searching for the user, it will send this message containing the auth connect code:

{
    "type": "searching",
    "auth-code": "AUTH#321",
    "code": "XXX#123"
}

Outcome

The outcome of the authentication will contain the queued connect code:

✅ User has been authenticated

{
    "type": "success",
    "code": "XXX#123"
}

❌ Authentication timed out:

{
    "type": "timeout",
    "code": "XXX#123"
}

❌ There was an error:

{
    "type": "err",
    "code": "XXX#123"
}

❌ There are no available authentication clients:

{
    "type": "full",
    "code": "XXX#123"
}