Skip to content

Local running version of an Authorization API in a container

License

Notifications You must be signed in to change notification settings

Authress/authress-local

Repository files navigation

Authress media banner

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. 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

Usage

Run the container locally:

Docker

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

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.

An example API request to check a user's authorization is:

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 to connect instead. If you are interested in already working starter kits for various languages check out the Authress starter kits, 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 if you have internet access. Otherwise, tokens can be generated by the container once it is running.

curl -XPOST -d'{ }' http://localhost:8888/api/authentication

Will return a valid access token in a JSON object:

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