Skip to content

API v2 - Authentication #9865

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kevinansfield opened this issue Sep 12, 2018 · 0 comments
Closed

API v2 - Authentication #9865

kevinansfield opened this issue Sep 12, 2018 · 0 comments
Assignees
Labels
affects:admin Anything relating to Ghost Admin affects:api Affects the Ghost API affects:server Issues relating to the server or core of Ghost feature [triage] New features we're planning or working on

Comments

@kevinansfield
Copy link
Member

kevinansfield commented Sep 12, 2018

We're working towards a new versioned API and making both the public and private APIs in Ghost first-class citizens. As part of this work we'll be overhauling the authentication methods for the new versioned API endpoints.

  • Content API = public content only, equivalent to current public API
  • Admin API = all content and settings, equivalent to current private API

Each API will live on a new endpoint and there will be three different authentication methods to access them depending on the API being used and the particular use-case...

  • /admin/
    • User / Password login with session cookie authentication. Used by Ghost-Admin and other admin clients such as the Android app
    • API keys with JWT authentication. Used by integrations such as Zapier or custom server-side apps
  • /content/
    • API key authentication using query parameters

As part of the overhaul, the new APIs will have the restrictive and confusing trusted_domains and client_id/client_secret concepts removed. HTTP access will be deprecated for the Admin API in production until Ghost 3.0 where the Admin API will become HTTPS-only.

We will be providing an SDK for making authenticated requests to the the new API endpoints.

The existing API will be deprecated but will continue to live on /api/v0.1/ with the current authentication methods until such time as the 0.1 version is fully removed from Ghost. See
#9866 for details on the new API endpoints and API versioning.

@kevinansfield kevinansfield added affects:admin Anything relating to Ghost Admin affects:server Issues relating to the server or core of Ghost affects:api Affects the Ghost API OAuth labels Sep 12, 2018
@kevinansfield kevinansfield added the feature [triage] New features we're planning or working on label Sep 13, 2018
@kevinansfield kevinansfield mentioned this issue Sep 13, 2018
12 tasks
allouis added a commit to allouis/Ghost-SDK that referenced this issue Sep 18, 2018
refs TryGhost/Ghost#9865

Adds jsonwebtoken and got
allouis added a commit to allouis/Ghost-SDK that referenced this issue Sep 18, 2018
refs TryGhost/Ghost#9865

Adds eslint, eslint-plugin-ghost, mocha and sinon
allouis added a commit to allouis/Ghost-SDK that referenced this issue Sep 18, 2018
allouis added a commit to allouis/Ghost-SDK that referenced this issue Sep 18, 2018
allouis added a commit to allouis/Ghost-SDK that referenced this issue Sep 18, 2018
allouis added a commit to allouis/Ghost-SDK that referenced this issue Sep 18, 2018
allouis added a commit to allouis/Ghost-SDK that referenced this issue Sep 18, 2018
allouis added a commit to allouis/Ghost-SDK that referenced this issue Sep 18, 2018
allouis added a commit to allouis/Ghost-SDK that referenced this issue Sep 18, 2018
refs TryGhost/Ghost#9865

This should make it easier to use in development
allouis added a commit to allouis/Ghost-SDK that referenced this issue Sep 18, 2018
allouis added a commit to allouis/Ghost-SDK that referenced this issue Sep 18, 2018
kirrg001 added a commit that referenced this issue Jan 18, 2019
refs #9865

- the outer authentication layer wants a consistent interface of each authentication package
  - admin.authenticate
  - session.authenticate

- furthermore, there is no need to put the full feature into the exposed function name
kirrg001 added a commit that referenced this issue Jan 18, 2019
kirrg001 added a commit that referenced this issue Jan 18, 2019
kirrg001 added a commit that referenced this issue Jan 18, 2019
refs #9865

- small refactoring to make both session and admin api key handling similar
- admin api key authentication is still disabled, but easy to enable
- added proof test how to authenticate using admin api keys
@allouis allouis assigned naz and kirrg001 and unassigned allouis Jan 21, 2019
naz added a commit to naz/Ghost that referenced this issue Jan 23, 2019
refs TryGhost#9865

- Extracted tests related to Admin API key authenticatoin into separate
acceptance test suite
naz added a commit to naz/Ghost that referenced this issue Jan 23, 2019
refs TryGhost#9865

- Changed key format to {id}:{secret} so API consumer only has to worry about copying a single value during setup
- Updated key expiration time in getValidAdminToken test helper to match server side expiration check
naz added a commit to naz/Ghost that referenced this issue Jan 24, 2019
refs TryGhost#9865

- Changed id passed for api_key to an object to be able to differenciate between admin and content api requests
- Added integration id to frame context
- Small refactoring of frame context initialization
naz added a commit that referenced this issue Jan 24, 2019
refs #9865

- Changed id passed for api_key to an object to be able to differenciate between admin and content api requests
- Added integration id to frame context
- Small refactoring of frame context initialization
naz added a commit that referenced this issue Jan 30, 2019
kirrg001 added a commit that referenced this issue Jan 31, 2019
naz added a commit that referenced this issue Feb 1, 2019
refs #9865

- Added some clarificatoin around why secret used for token verification has to be transformed binary decoded from hex
kevinansfield added a commit that referenced this issue Feb 6, 2019
kirrg001 added a commit to kirrg001/Ghost that referenced this issue Feb 6, 2019
kirrg001 added a commit that referenced this issue Feb 6, 2019
kirrg001 added a commit to kirrg001/Ghost that referenced this issue Feb 7, 2019
refs TryGhost#9865

- was not sure about allowing to edit webhooks
kirrg001 added a commit that referenced this issue Feb 7, 2019
refs #9865

- was not sure about allowing to edit webhooks
kirrg001 added a commit that referenced this issue Feb 23, 2019
refs #9865

- see dbd3832
- we are not aware of any use cases so far
- reverting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:admin Anything relating to Ghost Admin affects:api Affects the Ghost API affects:server Issues relating to the server or core of Ghost feature [triage] New features we're planning or working on
Projects
None yet
Development

No branches or pull requests

5 participants