Skip to content

Commit e6e2fc7

Browse files
committed
local IdP
1 parent a7b2d03 commit e6e2fc7

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,20 @@ python examples/delegation/entra_obo_compat_demo.py \
142142
--scope "$ENTRA_SCOPE"
143143
```
144144

145+
### Local IdP quick command
146+
147+
```bash
148+
export LOCAL_IDP_SIGNING_KEY="replace-with-strong-secret"
149+
predicate-authorityd \
150+
--host 127.0.0.1 \
151+
--port 8787 \
152+
--mode local_only \
153+
--policy-file examples/authorityd/policy.json \
154+
--identity-mode local-idp \
155+
--local-idp-issuer "http://localhost/predicate-local-idp" \
156+
--local-idp-audience "api://predicate-authority"
157+
```
158+
145159
## Operations CLI
146160

147161
`predicate-authority` provides an ops-focused CLI for sidecar/runtime workflows.

predicate_authority/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,25 @@ python examples/delegation/entra_obo_compat_demo.py \
7171
--client-secret "$ENTRA_CLIENT_SECRET" \
7272
--scope "${ENTRA_SCOPE:-api://predicate-authority/.default}"
7373
```
74+
75+
## Local IdP quick example
76+
77+
```python
78+
from predicate_authority import LocalIdPBridge, LocalIdPBridgeConfig
79+
from predicate_contracts import PrincipalRef, StateEvidence
80+
81+
bridge = LocalIdPBridge(
82+
LocalIdPBridgeConfig(
83+
issuer="http://localhost/predicate-local-idp",
84+
audience="api://predicate-authority",
85+
signing_key="replace-with-strong-secret",
86+
token_ttl_seconds=300,
87+
)
88+
)
89+
90+
token = bridge.exchange_token(
91+
PrincipalRef(principal_id="agent:local", tenant_id="tenant-a"),
92+
StateEvidence(source="backend", state_hash="sha256:local-state"),
93+
)
94+
print(token.provider.value, token.access_token[:24] + "...")
95+
```

0 commit comments

Comments
 (0)