diff --git a/API.md b/API.md index eef71f2..f2a9d5f 100755 --- a/API.md +++ b/API.md @@ -3,7 +3,7 @@ **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`, +`GitHub`, `GitLab`, `Google Plus`, `Google`, `Instagram`, `LinkedIn`, `Medium`, `Meetup`, `Nest`, `Office365`, `Okta`, `Phabricator`, `Pingfed`, `Pinterest`, `Reddit`, `Salesforce`, `Slack`, `Spotify`, `Stripe`, `trakt.tv`, `Tumblr`, `Twitch`, `Twitter`, `VK`, `Wordpress`, `Windows Live`, and `Yahoo`. diff --git a/Providers.md b/Providers.md index ba9272b..3475135 100755 --- a/Providers.md +++ b/Providers.md @@ -459,21 +459,6 @@ credentials.profile = { }; ``` -### Mixer - -[Provider Documentation](https://dev.mixer.com/reference/oauth/index.html) - -- `scope`: Defaults to `['user:details:self']` -- `config`: not applicable -- `auth`: https://mixer.com/oauth/authorize -- `token`: https://mixer.com/api/v1/oauth/token - -The default profile response will look like this: - -```javascript -//Default profile response from Mixer -``` - ### Nest [Provider Documentation](https://developer.nest.com/documentation/cloud/how-to-auth) diff --git a/lib/index.d.ts b/lib/index.d.ts index 5443249..9cef179 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -30,7 +30,6 @@ export type Provider = | 'live' | 'medium' | 'meetup' - | 'mixer' | 'nest' | 'okta' | 'phabricator' diff --git a/lib/providers/index.js b/lib/providers/index.js index 8a0cef6..4f0b857 100755 --- a/lib/providers/index.js +++ b/lib/providers/index.js @@ -25,7 +25,6 @@ exports = module.exports = { live: require('./live'), medium: require('./medium'), meetup: require('./meetup'), - mixer: require('./mixer'), nest: require('./nest'), okta: require('./okta'), phabricator: require('./phabricator'), diff --git a/lib/providers/mixer.js b/lib/providers/mixer.js deleted file mode 100755 index 1037cc2..0000000 --- a/lib/providers/mixer.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - -const internals = {}; - - -exports = module.exports = function (options) { - - return { - protocol: 'oauth2', - useParamsAuth: true, - auth: 'https://mixer.com/oauth/authorize', - token: 'https://mixer.com/api/v1/oauth/token', - scope: ['user:details:self'], - scopeSeparator: ' ', - profile: async function (credentials, params, get) { - - const queryOptions = { - oauth_token: params.access_token - }; - - const profile = await get('https://mixer.com/api/v1/users/current', queryOptions); - credentials.profile = profile; - } - }; -}; diff --git a/test/providers/mixer.js b/test/providers/mixer.js deleted file mode 100755 index 9dbeeb8..0000000 --- a/test/providers/mixer.js +++ /dev/null @@ -1,73 +0,0 @@ -'use strict'; - -const Bell = require('../..'); -const Code = require('@hapi/code'); -const Hapi = require('@hapi/hapi'); -const Hoek = require('@hapi/hoek'); -const Lab = require('@hapi/lab'); - -const Mock = require('../mock'); - - -const internals = {}; - - -const { describe, it } = exports.lab = Lab.script(); -const expect = Code.expect; - - -describe('mixer', () => { - - it('authenticates with mock', async (flags) => { - - const mock = await Mock.v2(flags); - const server = Hapi.server({ host: 'localhost', port: 80 }); - await server.register(Bell); - - const custom = Bell.providers.mixer(); - Hoek.merge(custom, mock.provider); - - const profile = { - id: 930, - username: 'Mappa', - email: 'mappa@example.com' - }; - - Mock.override('https://mixer.com/api/v1/users/current', profile); - - server.auth.strategy('custom', 'bell', { - password: 'cookie_encryption_password_secure', - isSecure: false, - clientId: 'mixer', - clientSecret: 'secret', - provider: custom - }); - - server.route({ - method: '*', - path: '/login', - config: { - auth: 'custom', - handler: function (request, h) { - - return request.auth.credentials; - } - } - }); - - const res1 = await server.inject('/login'); - const cookie = res1.headers['set-cookie'][0].split(';')[0] + ';'; - - const res2 = await mock.server.inject(res1.headers.location); - - const res3 = await server.inject({ url: res2.headers.location, headers: { cookie } }); - expect(res3.result).to.equal({ - provider: 'custom', - token: '456', - expiresIn: 3600, - refreshToken: undefined, - query: {}, - profile - }); - }); -});