https://github.com/oslokommune/okdata-token-service
REST API for generating user tokens with Keycloak
https://github.com/oslokommune/okdata-token-service
dataplatform
Last synced: 28 days ago
JSON representation
REST API for generating user tokens with Keycloak
- Host: GitHub
- URL: https://github.com/oslokommune/okdata-token-service
- Owner: oslokommune
- License: mit
- Created: 2021-06-24T08:23:41.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2026-01-12T08:44:32.000Z (about 1 month ago)
- Last Synced: 2026-01-12T18:28:30.926Z (about 1 month ago)
- Topics: dataplatform
- Language: Python
- Homepage:
- Size: 804 KB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Token Service
======================
REST API for creating access tokens in Keycloak from user and client credentials.
## Setup
1. [Install Serverless Framework](https://serverless.com/framework/docs/getting-started/)
2. Install plugins:
```
sls plugin install -n serverless-python-requirements
sls plugin install -n serverless-aws-documentation
```
## Running tests
Tests are run using [tox](https://pypi.org/project/tox/).
```
$ tox
```
Or
```
$ make test
```
## Deploy
Deploy to both dev and prod is automatic via GitHub Actions on push to
`main`. You can alternatively deploy from local machine with: `make deploy` or
`make deploy-prod`.
## Input event
Input event is a [lambda http proxy request event](https://serverless.com/framework/docs/providers/aws/events/apigateway/#example-lambda-proxy-event-default) with body:
```json
{
"username": "user1",
"password": "password123"
}
```
## Output
Output is a [lambda http proxy response event](https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html#api-gateway-simple-proxy-for-lambda-output-format) with body:
```json
{
"access_token": "some-access-token",
"expires_in": 300,
"refresh_expires_in": 1800,
"refresh_token": "some-refresh-token",
"token_type": "bearer",
"not-before-policy": 1563194597,
"session_state": "some-uuid",
"scope": "profile email"
}
```