The purpose of this project is to tie together grpc-gateway and keycloak authentication via swagger/grpcui.
Blog post also is available on nedo.tech
- Go to
/docker
directory and executedocker-compose up -d
command. Keycloak instance will be running. - Go to project root and do
make run
- Discover swaggerui, grpcui
- At swaggerui go to Authorize and use
myclient
as client_id. Login/pass is dev/dev.
- After starting the keycloak, the auto import will be performed (custom realm gateway, client myclient and user with dev/dev creds). Implicit Flow is enabled inside client. These creds should be used while authenticating inside the app!
- Also you can login to admin console with admin/admin creds.
- SwaggerUI is embedded in native go code with statik library. Swagger dist was tuned to consume
apidocs.swagger.json
- Swagger authorization is typical with Authorize button and client_id: myclient. Grpcui is redirecting to auth after page loaded and token is auto injected in metadata.