node-oauth2-server icon indicating copy to clipboard operation
node-oauth2-server copied to clipboard

Create simple examples for v3

Open mjsalinger opened this issue 9 years ago • 9 comments

mjsalinger avatar Nov 09 '16 11:11 mjsalinger

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 avatar Nov 09 '16 11:11 mjsalinger

@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 bookshelf or sequelize would make the dialect used (mostly) irrelevant.

maxtruxa avatar Nov 10 '16 12:11 maxtruxa

The "custom servers" example on the main readme doesn't work.
It says Request, .authenticate is not a function.

niknah avatar Dec 31 '16 00:12 niknah

@maxtruxa are you working on this? what is the status? do you need help? I can help with some of them..

abarisic86 avatar Jan 27 '17 17:01 abarisic86

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 avatar Feb 02 '17 08:02 p-bakker

@p-bakker Any updates on this?

njj avatar Mar 08 '17 13:03 njj

@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)

slavab89 avatar Mar 08 '17 20:03 slavab89

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, ...).

maxtruxa avatar Mar 20 '17 16:03 maxtruxa

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

manjeshpv avatar Apr 13 '17 16:04 manjeshpv