Reconcile external identity on Admin API requests #50
Labels
No labels
area/core
area/integration
area/release
security
type/bug
type/docs
type/epic
type/feature
type/infrastructure
type/test
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
#47 Enforce external identity for Ghost Admin sessions
frank/ghost-oauth
Reference
frank/ghost-oauth#50
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Prevent browser-authenticated Admin API requests from using a Ghost session that no longer matches the current external identity.
Requirements
Acceptance criteria
Further information and implementation sketch
Ghost mounts the API path separately from the
/ghostAdmin application. Browser API requests can therefore authenticate directly through the Ghost session middleware.The Admin API authentication chain currently resembles:
A possible design is to insert external-identity reconciliation after API-key authentication and before Ghost session authentication:
The reconciliation middleware should skip requests already authenticated with an API key:
This should use the same strict SSO exchange logic rather than duplicating identity parsing and lookup.
The middleware must distinguish between:
Ghost already contains logic for regenerating and assigning a verified session:
That function should be used when the current Ghost session belongs to a different user than the resolved external identity. The session should not be rotated on every request.
A more explicit implementation could let the SSO exchange middleware inspect the current session user:
The exact placement should ensure that:
Relevant implementation:
ghost/core/core/server/services/auth/authenticate.jsghost/core/core/server/services/auth/session/index.jsghost/core/core/server/services/auth/session/session-service.jsghost/core/core/server/web/api/endpoints/admin/middleware.jsghost/core/test/e2e-api/admin/sso.test.js