https://github.com/dmitrymomot/solauth
Issuing access token based on signed message by Solana wallet.
https://github.com/dmitrymomot/solauth
auth jwt-auth solana
Last synced: 3 months ago
JSON representation
Issuing access token based on signed message by Solana wallet.
- Host: GitHub
- URL: https://github.com/dmitrymomot/solauth
- Owner: dmitrymomot
- License: apache-2.0
- Created: 2023-03-07T12:40:18.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-22T16:29:09.000Z (10 months ago)
- Last Synced: 2025-01-11T18:30:06.219Z (4 months ago)
- Topics: auth, jwt-auth, solana
- Language: Go
- Homepage:
- Size: 13.5 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# solauth
[](https://github.com/dmitrymomot/solauth/actions/workflows/tests.yml)
Issuing access token based on signed message by Solana wallet.
## Usage
### 1. Start server
```bash
$ ./bin/server
```### 2. Request authorization
```bash
$ curl -X POST -H "Content-Type: application/json" -d '{"public_key": "[base58 encoded wallet address]"}' http://localhost:8080/auth/request
```### 3. Sign message
Sign the message with your wallet.
### 4. Get access token
```bash
$ curl -X POST -H "Content-Type: application/json" -d '{"public_key": "[base58 encoded wallet address]", "signature": "[base64 encoded signature]", "message": "[same message from first request]"}' http://localhost:8080/auth/verify
```### 5. Refresh access token
```bash
$ curl -X POST -H "Content-Type: application/json" -d '{"refresh_token": "[refresh token from prev req]"}' http://localhost:8080/auth/refresh
```