hapi-oauth2-access-token

1.0.6 • Public • Published

hapi-oauth2-access-token

This is a plugin for Hapijs server used to integrate OAuth2 Server.

Usage

  • Run the command npm install hapi-oauth2-access-token use the flag --save to add your package.json file.
  • Register plugin 😎
var HapiOAuth2AccessToken = require('hapi-oauth2-access-token')
 
server.register({
  register: HapiOAuth2AccessToken,
  options: {
    host: 'your-host',
    clientId: 'your-client-id',
    clientSecret: 'your-client-secret',
    protocol: 'http' // optional, default is http
  }
}
  • Set auth to your routes:
server.route({
  method: 'GET',
  path: '/',
  config: {
    auth: 'bearer',
    handler:  (request, reply) => {
      reply('private resource')
    }
  }
})
  • Enjoy the magic 🎉

Create with ❤️ by Yalo

Package Sidebar

Install

npm i hapi-oauth2-access-token

Weekly Downloads

8

Version

1.0.6

License

BSD-3-Clause

Last publish

Collaborators

  • nathali
  • alex_yalo
  • tarikferes
  • manuelcordon-yalo
  • waltermoorlag
  • reinholdyalo
  • cesar-aguirre-yalo
  • byronramos
  • adanmuguiro
  • uriel-yalo
  • ochoa_yalo
  • dapryalo
  • bonniemilianb
  • guilhermesborz
  • gago_ar
  • catyalere
  • jfelix-yalo
  • gabriel_yalo
  • janetyalo
  • julio.gonzalez
  • branmendozay
  • zkropotkine
  • fernandorincon
  • gustavoyalo
  • moisesflores22
  • josepablohm
  • yaogomezyalo
  • rommelyalopartner
  • yalo-engineering