Skip to content

Commit

Permalink
docs: add missing adapters and getting started guide
Browse files Browse the repository at this point in the history
  • Loading branch information
jankapunkt committed Nov 6, 2023
1 parent 1da9837 commit ff8cdad
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
8 changes: 4 additions & 4 deletions docs/docs/adapters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
Adapters
==========

The *oauth2-server* module is typically not used directly but through one of the available adapters, converting the interface to a suitable one for the HTTP server framework in use.
The *@node-oauth/oauth2-server* module is typically not used directly but through one of the available adapters, converting the interface to a suitable one for the HTTP server framework in use.

.. framework-agnostic but there are several officially supported adapters available for popular HTTP server frameworks such as Express_ and Koa_.
.. framework-agnostic but there are several officially supported adapters available for popular HTTP server frameworks such as Express_ and Koa_ (not maintained by us).
- express-oauth-server_ for Express_
- koa-oauth-server_ for Koa_

.. _express-oauth-server: https://npmjs.org/package/express-oauth-server
.. _express-oauth-server: https://www.npmjs.com/package/@node-oauth/express-oauth-server
.. _Express: https://npmjs.org/package/express
.. _koa-oauth-server: https://npmjs.org/package/koa-oauth-server
.. _Koa: https://npmjs.org/package/koa
Expand All @@ -32,5 +32,5 @@ Adapters typically do the following:

- Copy all fields from the :doc:`Response </api/response>` back to the framework-specific request object and send it.

Adapters should preserve functionality provided by *oauth2-server* but are free to add additional features that make sense for the respective HTTP server framework.
Adapters should preserve functionality provided by *@node-oauth/oauth2-server* but are free to add additional features that make sense for the respective HTTP server framework.

17 changes: 8 additions & 9 deletions docs/docs/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ Installation

oauth2-server_ is available via npm_.

.. _oauth2-server: https://npmjs.org/package/oauth2-server
.. _oauth2-server: https://www.npmjs.com/package/@node-oauth/oauth2-server
.. _npm: https://npmjs.org

.. code-block:: sh
$ npm install oauth2-server
$ npm install @node-oauth/oauth2-server
.. note:: The *oauth2-server* module is framework-agnostic but there are several officially supported adapters available for popular HTTP server frameworks such as Express_ and Koa_. If you're using one of those frameworks it is strongly recommended to use the respective adapter module instead of rolling your own.
.. note:: The *@node-oauth/oauth2-server* module is framework-agnostic but there are several officially supported adapters available for popular HTTP server frameworks such as Express_ and Koa_. If you're using one of those frameworks it is strongly recommended to use the respective adapter module instead of rolling your own.

.. _Express: https://npmjs.org/package/express-oauth-server
.. _Express: https://www.npmjs.com/package/@node-oauth/express-oauth-server
.. _Koa: https://npmjs.org/package/koa-oauth-server


Expand All @@ -28,13 +28,12 @@ Features
========

- Supports :ref:`authorization code <AuthorizationCodeGrant>`, :ref:`client credentials <ClientCredentialsGrant>`, :ref:`refresh token <RefreshTokenGrant>` and :ref:`password <PasswordGrant>` grant, as well as :ref:`extension grants <ExtensionGrants>`, with scopes.
- Can be used with *promises*, *ES6 generators* and *async*/*await* (using Babel_).
- Can be used with *promises*, *ES6 generators* and *async*/*await*.
- Fully :rfc:`6749` and :rfc:`6750` compliant.
- Implicitly supports any form of storage, e.g. *PostgreSQL*, *MySQL*, *MongoDB*, *Redis*, etc.
- Complete `test suite`_.

.. _Babel: https://babeljs.io
.. _test suite: https://github.com/oauthjs/node-oauth2-server/tree/master/test
.. _test suite: https://github.com/node-oauth/node-oauth2-server/tree/master/test


.. _quick-start:
Expand All @@ -46,7 +45,7 @@ Quick Start

::

const OAuth2Server = require('oauth2-server');
const OAuth2Server = require('@node-oauth/oauth2-server');

const oauth = new OAuth2Server({
model: require('./model')
Expand Down Expand Up @@ -78,7 +77,7 @@ Quick Start

::

const AccessDeniedError = require('oauth2-server/lib/errors/access-denied-error');
const AccessDeniedError = require('@node-oauth/oauth2-server/lib/errors/access-denied-error');

oauth.authorize(request, response)
.then((code) => {
Expand Down

0 comments on commit ff8cdad

Please sign in to comment.