1.0.6 • Published 7 years ago

hapi-oauth2-access-token v1.0.6

Weekly downloads
1
License
BSD-3-Clause
Repository
-
Last release
7 years ago

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 :sunglasses:
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 :tada:

Create with :heart: by Yalo

1.0.6

7 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago