Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/authress/authress-local
Local running version of an Authorization API in a container
https://github.com/authress/authress-local
api authentication authorization authress container offline sdk security
Last synced: 2 months ago
JSON representation
Local running version of an Authorization API in a container
- Host: GitHub
- URL: https://github.com/authress/authress-local
- Owner: Authress
- License: agpl-3.0
- Created: 2023-07-27T15:55:57.000Z (over 1 year ago)
- Default Branch: release/0.1
- Last Pushed: 2024-02-01T16:23:41.000Z (12 months ago)
- Last Synced: 2024-10-28T17:42:53.812Z (3 months ago)
- Topics: api, authentication, authorization, authress, container, offline, sdk, security
- Language: Rust
- Homepage: https://authress.io
- Size: 225 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: contributing.md
- License: LICENSE
Awesome Lists containing this project
README
# Authress Local
Authress Local provides a local running version of an Authorization API in a container. Use Docker, Podman, Nomad or another container management solution to run authorization and authentication directly on your localhost.
Authress local stands up an API that offers parity with the [Authress Authorization API](https://authress.io/app/#/api). You can use Authress local to build authentication and authorization directly into your applications and services.
Additionally, Authress local is great way to develop with Authress without needing to have an Authress account.
## Documentation
* [Full container documentation](https://authress.io/knowledge-base/docs/SDKs/authress-local)## Usage
Run the container locally:#### Docker
```sh
docker pull authress/authress-local:latest
docker run -d -p 8888:8888 authress/authress-local:latest
# Run in terminal: docker run -d -p 8888:8888 authress/authress-local:latest
```#### Podman
```sh
podman pull ghcr.io/authress/authress-local:latest
podman run -d -p 8888:8888 authress/authress-local:latest
# Run in terminal: podman run -d -p 8888:8888 authress/authress-local:latest
```This will run the container locally on port `8888`, if you want to run the container on a different port, change the `8888` to another port number.
The api for the running container matches the API at [Authress APi](https://authress.io/app/#/api).
An example API request to check a user's authorization is:
```bash
curl localhost:8888/v1/users/USER/resources/RESOURCE/permissions/PERMISSION
```Where `USER` would be the user, `RESOURCE` is the resource uri,and the `PERMISSION` is the permission. Authress recommends using one of the many [SDKs](https://authress.io/knowledge-base/docs/SDKs) to connect instead. If you are interested in already working starter kits for various languages check out the [Authress starter kits](https://authress.io/knowledge-base/docs/SDKs), they are listed by language.
### Generating a JWT for use with your service
The Authress Local container supports dynamically generating valid JWT tokens. Tokens can be also generated by the [Authress Management Portal](https://authress.io/app/#/authress-local?focus=token-generation) if you have internet access. Otherwise, tokens can be generated by the container once it is running.```bash
curl -XPOST -d'{ }' http://localhost:8888/api/authentication
```Will return a valid access token in a JSON object:
```bash
200
{
"accessToken":
"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImF1dGhyZXNzLWxvY2FsIn0.eyJhdWQiOiJsb2NhbGhvc3QiLCJleHAiOjE3MDU4NjIzNjksImlhdCI6MTcwNTc3NTk2OSwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDo4ODg4Iiwic3ViIjoibWUifQ.F_PiFTg7ir0bDhet_AVs6aeIxbBycXUso-J7sUA22iWK6p4pOUFoyMJTr6ZD_GCEQqI314WMmjllK9GZ9spTBQ"
}
```## Contributing to Authress Local
Want to contribute to Authress local, check out the [Contribution and Development Guide](./contributing.md)