Create simple examples for v3
Hey @maxtruxa, you up for helping to create a few examples similar to what's in v2? We could split the work if you have the time.
@mjsalinger Sure, which backends do we want examples for?
- "memory": This one is probably great to visualize requirements without having to think about the actual storage implementation.
- MongoDB: With or without
mongoose? - SQL: Plain SQL, and if so, which dialect? Using an ORM like
bookshelforsequelizewould make the dialect used (mostly) irrelevant.
The "custom servers" example on the main readme doesn't work.
It says Request, .authenticate is not a function.
@maxtruxa are you working on this? what is the status? do you need help? I can help with some of them..
I could contribute an example of using node-oauth2-server with plain NodeJs (so no Koa/Express), if it works (see #358 and #357)
I'm also thinking that it might be beneficial to the project to provide some mode documentation about the flow of oAuth2 2 in general and how to integrate node-oauth2-server into your own projects, along the lines of:
- https://developer.github.com/v3/oauth/
- https://www.digitalocean.com/community/tutorials/an-introduction-to-oauth-2
I'd be willing to contribute to that as well.
Maybe the later topic is more suited to be located under #341
@p-bakker Any updates on this?
@maxtruxa @mjsalinger I've created a working example of this with mongodb https://github.com/slavab89/oauth2-server-example-mongodb Please see if it helps and update us on the status of the project if possible (version 3 and all)
I'm almost done with an example application building on top of a model with memory backing.
The application is basically a small authorization server with a web frontend for managing users, clients and access/refresh tokens and a single protected resource.
Additional examples would preferably provide just the model.js used by OAuth2Server, as well as an extended-model.js for managing clients, users and tokens through the web frontend. This way there is one fully functional example application for poking around the module that can be run with any backing (memory, PostgreSQL, MySQL, MongoDB, ...).
Look once into #393
Sequelize Models https://github.com/manjeshpv/node-oauth2-server-implementation/blob/master/components/oauth/models.js Mongodb: https://github.com/slavab89/oauth2-server-example-mongodb/blob/master/model.js