Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

att-express-auth

Package Overview
Dependencies
0
Maintainers
3
Versions
4
Issues
File Explorer

Advanced tools

att-express-auth

Drop-in auth middleware for alpha-auth AT&T.

    0.0.4latest

Version published
Maintainers
3
Weekly downloads
3

Weekly downloads

Readme

Source

AT&T Alpha-auth middleware for Express.js

Super simple oauth middleware for AT&T's alpha auth

First you have to go register your application and get a client ID and client secret. Just drop those into the code below and then just add a link or button that points to /auth somewhere on your page and you're good to go.

install

npm install att-express-auth

The code below should work once you've dropped in your client id and secret:

var express = require('express'), attAuth = require('att-express-auth'), app = express(); // config our middleware app.use(express.cookieParser()); app.use(express.session({ secret: 'phone phone phone' })); app.use(attAuth.middleware({ app: app, clientId: 'YOUR CLIENT ID', clientSecret: 'YOUR CLIENT SECRET', scopes: ['profile', 'addessbook', 'locker', 'messages', 'geo'], accountsUrl: 'https://auth.tfoundry.com' // whatever accounts server you want to use, defaults to https://auth.tfoundry.com redirectUrl: 'http://localhost:3000/secured' // whatever URL you want users to be redirected to after auth })); app.get('/', function (req, res) { res.send('<h1>AT&T Express App sample</h1><a href="/auth">login</a>'); }); app.get('/login', function (req, res) { res.send('<h1>Please login</h1><a href="/auth">login</a>'); }); app.get('/login-failed', function (req, res) { res.send('<h1>Login failed</h1>'); }); app.get('/secured', attAuth.secure(), function (req, res) { res.send(req.session.user); }); app.get('/other-secured', attAuth.secure(), function (req, res) { res.send(req.session.user); }); app.listen(3000); console.log('Demo AT&T auth app running on port 3000');

FAQs

What is att-express-auth?

Drop-in auth middleware for alpha-auth AT&T.

Is att-express-auth popular?

The npm package att-express-auth receives a total of 3 weekly downloads. As such, att-express-auth popularity was classified as not popular.

Is att-express-auth well maintained?

We found that att-express-auth demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 3 open source maintainers collaborating on the project.

Last updated on 13 May 2013

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc