Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
nsklikas committed Jan 9, 2024
1 parent 462e287 commit c0c9365
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ At the moment the application is sourcing the following from the environment:


## Container

To build the UI oci image, you will need [rockcraft](https://canonical-rockcraft.readthedocs-hosted.com).

To install rockcraft run:
Expand Down Expand Up @@ -106,7 +107,7 @@ export PORT=4455
export TRACING_ENABLED=false
export LOG_LEVEL=debug
export AUTHORIZATION_ENABLED=false
./cmd/app
./app serve
```

To test the authorizatoin code flow you can use the Ory Hydra CLI:
Expand All @@ -130,3 +131,34 @@ hydra perform authorization-code \
--client-secret `echo "$code_client" | yq .client_secret` \
--scope openid,profile,email,offline_access
```

## OpenFGA Model Creation

The login UI relies to [OpenFGA](https://github.com/openfga/openfga/) for authorization decisions.
After you deploy the OpenFGA server, you need to create the OpenFGA store and model:

```console
./login-ui-binary create-fga-model --fga-api-token $OPENFGA_API_TOKEN --fga-api-url $OPENFGA_API_URL --store-id $STORE_ID
```

To try it locally you can deploy OpenFGA using docker-compose:
```console
docker-compose -f docker-compose.dev.yml --build --force-recreate up
```

And run with the store:
```console
make build
./app create-fga-model --fga-api-token 42 --fga-api-url http://localhost:8080 --store-id 01GP1254CHWJC1MNGVB0WDG1T0

export KRATOS_PUBLIC_URL=http://localhost:4433
export HYDRA_ADMIN_URL=http://localhost:4445
export BASE_URL=http://localhost:4455
export OPENFGA_API_SCHEME=http
export OPENFGA_API_HOST=localhost:8080
export OPENFGA_STORE_ID=01GP1254CHWJC1MNGVB0WDG1T0
export OPENFGA_API_TOKEN=42
export OPENFGA_AUTHORIZATION_MODEL_ID=01HGG9ZQ9PP3P6QHW93QBM55KM
export AUTHORIZATION_ENABLED=false
./app serve
```

0 comments on commit c0c9365

Please sign in to comment.