Run Auth Locally#
BlueAPI can be secured using OIDC authenticaiton. For development it can be useful to run a containerised version of the OIDC stack, to serve a local instance of BlueAPI.
To run the stack:
In the root directory run
git submodule update --init --recursiveto initialise the example-services repoRun
docker compose -f tests/system_tests/compose.yaml up -dto launch an instance of NumTracker, RabbitMQ, Keycloak, Tiled, OPA and a number of IOCs, in detached modeRun
source tests/system_tests/.envwhich will set required EPICS environmental variablesRun
blueapi -c tests/system_tests/config.yaml serveto launch BlueAPI configured to use the launched stack. This may take a while, as BlueAPI will attempt to connect to a number of devices via Channel Access
To log in through the BlueAPI CLI:
Run
blueapi login(if you want to run a plan with stomp config, add the-c tests/system_tests/config.yamlparameter)Follow the login prompted to Keycloak, then log in with the username
adminand passwordadminWhen prompted by Keycloak, grant BlueAPI access to the listed privileges
Run
blueapi controller plansto check that the log in has succeeded
By default the BlueAPI instance will be available via the OAuth2 proxy at localhost:4180, and Tiled through its OAuth2 proxy at localhost:4181.