Add federated-authorization example#48
Open
sohanmaheshwar wants to merge 6 commits into
Open
Conversation
A self-contained demo of federated authentication with centralized fine-grained authorization in SpiceDB: users log in through different identity providers (Keycloak OIDC and GitHub OAuth), each external account binds to a canonical internal user, and a single SpiceDB instance enforces document access control across all of them. Signed-off-by: Sohan Maheshwar <1119120+sohanmaheshwar@users.noreply.github.com>
Signed-off-by: Sohan Maheshwar <1119120+sohanmaheshwar@users.noreply.github.com>
Add document-start marker and quote all string values to satisfy the repo's quoted-strings yamllint rule. Signed-off-by: Sohan Maheshwar <1119120+sohanmaheshwar@users.noreply.github.com>
The edit/share/unshare handlers interpolated the user-controlled doc_id path parameter straight into a redirect Location, which CodeQL flagged as URL redirection from a remote source. Document ids are always uuid.uuid4(), so normalize doc_id through uuid.UUID() at the top of each handler: invalid ids now return 404, and the redirect target can only contain hex digits and hyphens, so it cannot escape the /documents/ path. Signed-off-by: Sohan Maheshwar <1119120+sohanmaheshwar@users.noreply.github.com>
sohanmaheshwar
force-pushed
the
federated-authorization-example
branch
from
July 23, 2026 08:51
e4c2d14 to
1d43f54
Compare
SpiceDB's REST gateway listens on :8443 inside the container, but the port was mapped from host 8090 to container 8080, so the documented http://localhost:8090 endpoint was unreachable (connection refused). Map 8090:8443 so the REST API is actually exposed. Signed-off-by: Sohan Maheshwar <1119120+sohanmaheshwar@users.noreply.github.com>
Signed-off-by: Sohan Maheshwar <1119120+sohanmaheshwar@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a new
federated-authorizationexample: a self-contained demo of federated authentication with centralized fine-grained authorization in SpiceDB.Users log in through different identity providers (Keycloak OIDC and GitHub OAuth). Each external account (
keycloak_account,github_account) binds to a canonical internaluser, and a single SpiceDB instance enforcesdocumentaccess control across all of them — so users from different IdPs can share resources with each other.Contents
app.py) with Keycloak + GitHub login flowsspicedb/schema.zed) with the*_account → bound_to → userbinding patterndocker-compose.ymlbringing up SpiceDB, Keycloak, and the appEverything runs locally via
docker compose. Secrets are demo placeholders only; no real credentials are included.Notes
spicedb/tutorials/federated-authorization.