passport-hue
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Passport Hue Strategy

Strategy to authenticate with Hue via OAuth2 in Passport

For more details, read the Hue developer docs at https://developers.meethue.com/develop/hue-api/remote-authentication/

Installation

$ npm install passport-hue

Usage

Assuming an express app:

const HueStrategy = require('passport-hue').Strategy;

passport.use(new HueStrategy({
    clientID: CLIENT_ID,
    clientSecret: CLIENT_SECRET,
    appID: APP_ID,
    deviceID: DEVICE_ID,
    deviceName?: DEVICE_NAME,
}));

app.get('/auth/hue', passport.authenticate('hue'));
app.get('/auth/hue/callback',
    passport.authenticate('hue', {}),
    function (req, res) {
        // access token is in req.user.accessToken
        // refresh token is in req.user.refreshToken
        // expires in req.user.expires_in seconds
    }
);

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

/passport-hue/

    Package Sidebar

    Install

    npm i passport-hue

    Weekly Downloads

    1

    Version

    1.0.2

    License

    Apache-2.0

    Unpacked Size

    19.6 kB

    Total Files

    6

    Last publish

    Collaborators

    • ferrantejake