diff --git a/lib/cli.js b/lib/cli.js index a630609e..9d3b3ce4 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -573,6 +573,42 @@ program }) }) +program + .command('auth-openid') + .description('start openid auth client') + .option('-p, --port ' + , 'port (or $PORT)' + , Number + , process.env.PORT || 7120) + .option('-s, --secret ' + , 'secret (or $SECRET)' + , String + , process.env.SECRET) + .option('-a, --app-url ' + , 'URL to app' + , String) + .option('--identifier ' + , 'identifier' + , String) + .action(function(options) { + if (!options.identifier) { + this.missingArgument('--identifier') + } + if (!options.secret) { + this.missingArgument('--secret') + } + if (!options.appUrl) { + this.missingArgument('--app-url') + } + + require('./units/auth/openid')({ + port: options.port, + secret: options.secret, + appUrl: options.appUrl, + identifier: options.identifier + }) + }) + program .command('notify-hipchat') .description('start HipChat notifier') @@ -1014,7 +1050,7 @@ program , 'device pull endpoint' , String , 'tcp://127.0.0.1:7116') - .option('--auth-type ' + .option('--auth-type ' , 'auth type' , String , 'mock') diff --git a/lib/units/auth/openid.js b/lib/units/auth/openid.js index e26d0380..eb0ae5be 100644 --- a/lib/units/auth/openid.js +++ b/lib/units/auth/openid.js @@ -1,5 +1,4 @@ var http = require('http') - var urljoin = require('url-join') var express = require('express') var validator = require('express-validator') @@ -28,7 +27,6 @@ var extensions = [new openid.SimpleRegistration({ module.exports = function(options) { var verifyUrl = urljoin(options.appUrl, "/auth/verify"); - console.log(verifyUrl); var relyingParty = new openid.RelyingParty( verifyUrl, @@ -42,14 +40,6 @@ module.exports = function(options) { , app = express() , server = Promise.promisifyAll(http.createServer(app)) - // lifecycle.observe(function() { - // log.info('Waiting for client connections to end') - // return server.closeAsync() - // .catch(function() { - // // Okay - // }) - // }) - app.set('strict routing', true) app.set('case sensitive routing', true)