🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

passport-appc

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

passport-appc

Appcelerator authentication strategy for Passport.

latest
Source
npmnpm
Version
0.2.1
Version published
Maintainers
2
Created
Source

Passport-Appcelerator

Passport strategy for authenticating with Appcelerator Dashboard using its session ID shared via a cookie. Subsequently, the web application implementing this strategy must run under the same (secured) domain.

This module lets you authenticate using Appcelerator in your Node.js applications. By plugging into Passport, Appcelerator authentication can be easily and unobtrusively integrated into any application or framework that supports Connect-style middleware, including Express.

Install

$ npm install passport-appc

Usage

Configure Strategy

The Appcelerator authentication strategy authenticates users using a Appcelerator account. The strategy requires a verify callback, which accepts the session data and calls done providing a user, as well as options specifying an optional Appcelerator Dashboard and callback URL.

AppcStrategy = require('passport-appc').Strategy;

passport.use(new AppcStrategy({
		appcURL: "https://360-preprod.cloud.appctest.com",
		callbackURL: "https://something.cloud.appctest.com"
	},
	function(session, done) {
		User.findOrCreate({ appcId: session.user.id }, function (err, user) {
  			return done(err, user);
		});
	}
));

Authenticate Requests

Use passport.authenticate(), specifying the 'appc' strategy, to authenticate requests.

For example, as route middleware in an Express application:

app.get('/auth/appc',
  passport.authenticate('appc'));

app.get('/auth/appc/callback', 
  passport.authenticate('appc', { failureRedirect: '/login' }),
  function(req, res) {
    // Successful authentication, redirect home.
    res.redirect('/');
  });

Tests

$ npm install
$ npm test

License

This source code is the intellectual property of Appcelerator, Inc. Copyright (c) 2014-2015 Appcelerator, Inc. All Rights Reserved. This code MUST not be modified, copy or otherwise redistributed without expression written permission of Appcelerator. This software is licensed as part of the Appcelerator Platform and governed under the terms of the Appcelerator license agreement.

Distribution through the NPM package system located at http://npmjs.org is expressly granted if the package you are downloading is from the official Appcelerator account at http://npmjs.org/package/passport-appc.

Keywords

passport

FAQs

Package last updated on 09 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts