https://github.com/alexey-dobry/go-auth
Go Auth is simple authorization service
https://github.com/alexey-dobry/go-auth
gorm grpc jwt
Last synced: about 1 month ago
JSON representation
Go Auth is simple authorization service
- Host: GitHub
- URL: https://github.com/alexey-dobry/go-auth
- Owner: alexey-dobry
- Created: 2025-04-04T09:04:28.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-08-27T08:28:47.000Z (10 months ago)
- Last Synced: 2026-01-14T13:53:35.989Z (6 months ago)
- Topics: gorm, grpc, jwt
- Language: Go
- Homepage:
- Size: 65.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go Auth
> Simple authentication and permission checker service
### Requirements:
#### Docker:

You can install Docker there
### Installing:
1. Clone repository
2. Go to ./auth-service/config and setup config.yaml as specified in config.example.yaml
Note: it is crucial to set repository:host value equal to "auth-database"
3. Start the application
- for Windows users:
```bash
docker-compose build
```
```bash
docker-compose up
```
- for Linux users:
```bash
docker compose build
```
```bash
docker compose up
```
### GRPC methods
- **Register**: registers user in auth service and returns pair of jwt tokens(refresh and access)
- **Login**: returns pair of jwt tokens(refresh and access) if user is registered
- **Refresh**: returns pair of jwt tokens(refresh and access) if refresh token is valid
- **Validate**: validates access token
### Requests examples
- **Register**:
```
{
"email": "Roberto@gmail.com",
"first_name": "Andrey",
"last_name": "Svishev",
"password": "lorem_ipsum",
"username": "Youtubelover"
}
```
- **Login**:
```
{
"email": "Roberto@gmail.com",
"password": "lorem_ipsum"
}
```
- **Refresh**:
```
{
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NTYxMzU2MzIsImlkIjowLCJ1c2VybmFtZSI6IiIsImZpcnN0X25hbWUiOiIiLCJsYXN0X25hbWUiOiIiLCJpc19hZG1pbiI6ZmFsc2V9.DfqoXRbnabTbL8tL6HWej7lW_AciEV8mNriMlLxiM-E"
}
```
- **Validate**:
```
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NTYwNTY0MzIsImlkIjowLCJ1c2VybmFtZSI6ImV1IiwiZmlyc3RfbmFtZSI6Im1hZ25hIGV1IGN1bHBhIHZlbGl0IiwibGFzdF9uYW1lIjoiZXUgZnVnaWF0IG1pbmltIGFsaXF1YSIsImlzX2FkbWluIjpmYWxzZX0.lZZWH37PaWM2c0_MsamWjiW4qt6PzEkjTYQzQ5BgNWk"
}
```
### Response example
```
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NTYwNTY0MzIsImlkIjowLCJ1c2VybmFtZSI6ImV1IiwiZmlyc3RfbmFtZSI6Im1hZ25hIGV1IGN1bHBhIHZlbGl0IiwibGFzdF9uYW1lIjoiZXUgZnVnaWF0IG1pbmltIGFsaXF1YSIsImlzX2FkbWluIjpmYWxzZX0.lZZWH37PaWM2c0_MsamWjiW4qt6PzEkjTYQzQ5BgNWk",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NTYxMzU2MzIsImlkIjowLCJ1c2VybmFtZSI6IiIsImZpcnN0X25hbWUiOiIiLCJsYXN0X25hbWUiOiIiLCJpc19hZG1pbiI6ZmFsc2V9.DfqoXRbnabTbL8tL6HWej7lW_AciEV8mNriMlLxiM-E"
}
```