Skip to content

Commit 37df411

Browse files
committed
verified okta
1 parent e00d70e commit 37df411

4 files changed

Lines changed: 99 additions & 1 deletion

File tree

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
.PHONY: hooks lint test examples verify-release-order build-packages format format-python format-docs lint-docs
1+
.PHONY: hooks lint test examples verify-release-order build-packages format format-python format-docs lint-docs dev-install
2+
3+
dev-install:
4+
python -m pip install -e predicate_contracts -e predicate_authority
25

36
hooks:
47
pre-commit install

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ Implemented in this repository:
6161
pip install predicate-authority
6262
```
6363

64+
For local editable development in this monorepo, install both package roots
65+
(do not use `pip install -e .` at repo root):
66+
67+
```bash
68+
make dev-install
69+
# equivalent: python -m pip install -e predicate_contracts -e predicate_authority
70+
```
71+
6472
For shared contracts directly:
6573

6674
```bash

examples/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,9 @@ Check endpoints:
3636
```bash
3737
PYTHONPATH=. python examples/authorityd/daemon_endpoint_check.py
3838
```
39+
40+
## Okta compatibility example notes
41+
42+
For Okta OBO/token-exchange compatibility setup and troubleshooting, see:
43+
44+
- `examples/README_Okta.md`

examples/README_Okta.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Okta Example Notes
2+
3+
This note covers running the Okta delegation compatibility demo and fixing the
4+
most common setup issues.
5+
6+
## Prerequisites
7+
8+
- Populate `AgentIdentity/.env` with:
9+
- `OKTA_ISSUER`
10+
- `OKTA_CLIENT_ID`
11+
- `OKTA_CLIENT_SECRET`
12+
- `OKTA_AUDIENCE`
13+
- `OKTA_SCOPE` (defaults to `authority:check`)
14+
- Load env vars in your terminal:
15+
16+
```bash
17+
set -a
18+
source .env
19+
set +a
20+
```
21+
22+
## Run the compatibility demo
23+
24+
```bash
25+
python examples/delegation/okta_obo_compat_demo.py \
26+
--issuer "$OKTA_ISSUER" \
27+
--client-id "$OKTA_CLIENT_ID" \
28+
--client-secret "$OKTA_CLIENT_SECRET" \
29+
--audience "$OKTA_AUDIENCE" \
30+
--scope "${OKTA_SCOPE:-authority:check}"
31+
```
32+
33+
If your tenant supports token exchange/OBO, add:
34+
35+
```bash
36+
--supports-token-exchange
37+
```
38+
39+
Full command:
40+
41+
```bash
42+
python examples/delegation/okta_obo_compat_demo.py \
43+
--issuer "$OKTA_ISSUER" \
44+
--client-id "$OKTA_CLIENT_ID" \
45+
--client-secret "$OKTA_CLIENT_SECRET" \
46+
--audience "$OKTA_AUDIENCE" \
47+
--scope "$OKTA_SCOPE" \
48+
--supports-token-exchange
49+
```
50+
51+
## Common error: `invalid_scope`
52+
53+
Error example:
54+
55+
```text
56+
HTTP 400 ... {"error":"invalid_scope","error_description":"One or more scopes are not configured for the authorization server resource."}
57+
```
58+
59+
This means the requested scope (for example `authority:check`) is not configured
60+
for your Okta authorization server.
61+
62+
### Fix
63+
64+
1. In Okta Admin, open `Security -> API -> Authorization Servers -> default`.
65+
2. Add scope `authority:check` (or another scope you intend to use).
66+
3. In Access Policies, allow:
67+
- grant type: `Client Credentials`
68+
- scope: `authority:check` (or your chosen scope)
69+
4. Re-run the demo.
70+
71+
If you want a quick workaround, set `OKTA_SCOPE` to an existing scope that your
72+
app policy already allows.
73+
74+
## Compatibility behavior
75+
76+
- If `--supports-token-exchange` is set and tenant supports it:
77+
- output should report `delegation_path: idp_token_exchange`.
78+
- Otherwise:
79+
- output should report `delegation_path: authority_mandate_delegation`.
80+
81+
This keeps delegation deterministic even when IdP-native OBO is unavailable.

0 commit comments

Comments
 (0)