由于微信不是标准的oauth2结构,而且PR:438到官方仓库被拒绝(@hapi/bell 主要是国外的第三方),所以创建了这个仓库
hapi-bell-other
Third-party authentication plugin for hapi.
bell ships with built-in support for authentication using ArcGIS Online
, Auth0
, AzureAD
,
BitBucket
, Cognito
, DigitalOcean
, Discord
, Dropbox
, Facebook
, Fitbit
, Foursquare
,
GitHub
, GitLab
, Google Plus
, Google
, Instagram
, LinkedIn
, Medium
, Meetup
, Mixer
,
Nest
, Office365
, Okta
, Phabricator
, Pingfed
, Pinterest
, Reddit
, Salesforce
, Slack
,
Spotify
, Stripe
, trakt.tv
, Tumblr
, Twitch
, Twitter
, VK
, Wordpress
, Windows Live
,Yahoo
and Weixin
.
It also supports any compliant OAuth 1.0a
and OAuth 2.0
based login services with a simple
configuration object.
Documentation
Tutorials
Social Login with Twitter using hapi.js
Examples
Twitter:
// Load modules const Bell = ;const Hapi = ; // Declare internals const internals = {}; internals { const server = Hapi; // Register bell with the server await server; // Declare an authentication strategy using the bell scheme // with the name of the provider, cookie encryption password, // and the OAuth client credentials. serverauth; // Use the 'twitter' authentication strategy to protect the // endpoint handling the incoming authentication credentials. // This endpoint usually looks up the third party account in // the database and sets some application state (cookie) with // the local application account information. server; await serverstart;}; internalsstart;