WP-355 Ф17.5 — ORY auth вместо basic auth
- ORY OAuth2 client created (
scripts/create-ory-cf-client.sh) ORY_CLIENT_IDandORY_CLIENT_SECRETsaved in GitHub secrets- Access to Cloudflare Dashboard for
pwapps.comzone - Team name:
odd-dew-3a42(domain:odd-dew-3a42.cloudflareaccess.com)
- Open Cloudflare Zero Trust Dashboard
- Go to Settings → Authentication → Identity providers
- Click Add an identity provider → OpenID Connect (OIDC)
- Fill in:
- Name:
ORY-system-school - Client ID: (from
ORY_CLIENT_IDsecret) - Client secret: (from
ORY_CLIENT_SECRETsecret) - Auth URL:
https://auth.system-school.ru/hydra/oauth2/auth - Token URL:
https://auth.system-school.ru/hydra/oauth2/token - Certificate URL:
https://auth.system-school.ru/hydra/.well-known/jwks.json - Scopes:
openid,profile,email - Redirect URI: (already set by Pasha in ORY client)
https://odd-dew-3a42.cloudflareaccess.com/cdn-cgi/access/callback
- Name:
- Save
- Go to Access → Applications
- Click Add an application → Self-hosted
- Fill in:
- Application name:
dash-pwapps-guides - Session duration: 24 hours
- Domain:
dash.pwapps.com
- Application name:
- Add policies:
- Rule 1 (Allow): Selector
Email, Operatormatches regex, Value@aisystant.com|@iwe.io - Rule 2 (Allow): Selector
Email, Operatormatches regex, Value@system-school.ru
- Rule 1 (Allow): Selector
- Save
If functions/_middleware.js exists in this repo:
git rm functions/_middleware.js
git commit -m "chore(auth): remove basic auth middleware — ORY CF Access active"- Open
https://dash.pwapps.comin incognito window - Expect redirect to
auth.system-school.ru/hydra/oauth2/auth - Login with ORY credentials
- Expect redirect back to dash with access
| Symptom | Cause | Fix |
|---|---|---|
| 403 after login | Email domain not in policy | Add domain to CF Access policy |
invalid_client |
Wrong CLIENT_ID/SECRET | Re-run create-ory-cf-client.sh |
| Redirect loop | Callback URL mismatch | Verify ORY client redirect_uri = https://odd-dew-3a42.cloudflareaccess.com/cdn-cgi/access/callback |