# passport-ubuntu

> Ubuntu OpenID authentication strategy for Passport

Latest version **0.2.0** (published 2017-05-11) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install passport-ubuntu
pnpm add passport-ubuntu
yarn add passport-ubuntu
bun add passport-ubuntu
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2017-05-11 |
| First published | 2015-05-16 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Brian Douglass |
| Maintainers | bhdouglass |
| Keywords | passport, openid, ubuntu |

## Links

- npm: https://www.npmjs.com/package/passport-ubuntu
- Repository: https://github.com/bhdouglass/passport-ubuntu
- Homepage: https://github.com/bhdouglass/passport-ubuntu#readme
- Issues: https://github.com/bhdouglass/passport-ubuntu/issues
- npm.io page: https://npm.io/package/passport-ubuntu

## Dependencies (3)

- [openid](https://npm.io/package/openid.md) ^2.0.6
- [pkginfo](https://npm.io/package/pkginfo.md) ^0.4.0
- [passport-openid](https://npm.io/package/passport-openid.md) ^0.4.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2017-05-11
- 0.1.3 — 2016-11-24
- 0.1.2 — 2015-05-16
- 0.1.1 — 2015-05-16
- 0.1.0 — 2015-05-16

## README

# Passport-Ubuntu #

[Passport](http://passportjs.org/) strategy for authenticating with [Ubuntu](https://login.ubuntu.com/) using OpenID.

## Install ##

`$ npm install --save passport-ubuntu`

## Example ##

    passport.use(new UbuntuStrategy({
      returnURL: 'https://example.com/auth/ubuntu/return',
      realm: 'https://example.com',
      stateless: true,
    },
    function(identifier, profile, done) {
      User.findOne({identifier: identifier}, function(err, user) {
        if (err) {
          done(err);
        }
        else {
          done(null, user);
        }
      });
    }));

    app.post('/auth/ubuntu', passport.authenticate('ubuntu'));
    app.get('/auth/ubuntu/return', passport.authenticate('ubuntu', {
      successRedirect: '/auth/me',
      failureRedirect: '/auth/login'
    }));
    app.post('/auth/ubuntu/return', passport.authenticate('ubuntu', {
      successRedirect: '/auth/me',
      failureRedirect: '/auth/login'
    }));

    app.get('/auth/login', function(req, res) {
      res.send('<form action="/auth/ubuntu" method="post"><div><input type="submit" value="Sign In"/></div></form>');
    });

    app.get('/auth/me', function(req, res) {
      res.send(req.user);
    });

    app.get('/auth/logout', function(req, res){
      req.logout();
      res.redirect('/');
    });

## License ##

Copyright (C) 2017 [Brian Douglass](http://bhdouglass.com/)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3, as published
by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program.  If not, see <http://www.gnu.org/licenses/>.

---
_Source: https://npm.io/package/passport-ubuntu · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
