{"_id":"@akeraio/passport","_rev":"1-61a82965afede8ee2b78a90b395bfd01","name":"@akeraio/passport","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@akeraio/passport","version":"1.0.0","description":"Akera authentication strategy for Passport.","keywords":["passport","akera","auth","authentication","identity"],"author":{"name":"Marian Edu","email":"marian.edu@acorn.ro"},"main":"src/index.ts","dependencies":{"@akeraio/api":"^1.1.12","passport-strategy":"^1.0.0"},"scripts":{"prepublishOnly":"gulp build && gulp doc","test":"gulp test","doc":"gulp doc","build":"gulp build","lint":"eslint src/**/* --ext .ts","lint:fix":"eslint src/**/* --ext .ts --fix"},"devDependencies":{"@types/chai":"^4.2.11","@types/mocha":"^7.0.2","@types/node":"^14.0.20","@types/passport-strategy":"^0.2.35","@typescript-eslint/eslint-plugin":"^3.6.0","@typescript-eslint/parser":"^3.6.0","chai":"^4.2.0","del":"^5.1.0","eslint":"^7.4.0","express":"^4.17.1","gulp":"^4.0.2","gulp-istanbul":"^1.1.3","gulp-mocha":"^7.0.2","gulp-sequence":"^1.0.0","gulp-sourcemaps":"^2.6.5","gulp-strip-debug":"^3.0.0","gulp-typedoc":"^2.2.5","gulp-typescript":"^5.0.1","gulp-uglify-es":"^2.0.0","istanbul":"^0.4.5","passport":"^0.4.1","remap-istanbul":"^0.13.0","ts-node":"^8.10.2","typedoc":"^0.17.8","typescript":"^3.9.6"},"peerDependencies":{"express":"^4.17.1","passport":"^0.4.1"},"license":{"type":"MIT","url":"https://github.com/akera-io/passport-akera/raw/master/LICENSE"},"repository":{"type":"git","url":"git+https://github.com/akera-io/passport-akera.git"},"bugs":{"url":"https://github.com/akera-io/passport-akera/issues"},"engines":{"node":">= 0.4.0"},"gitHead":"c572b4586a87c597ef3cfa4cd8982469ec0e3749","homepage":"https://github.com/akera-io/passport-akera#readme","_id":"@akeraio/passport@1.0.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-93MU7s5Pg9mhWGr/DlBg3+oWKk3yRaeUwLQEP1SxyF5mYKuMgW2guLei/Hs6FzKZocNFIoDdSzZ/cINgnVxkqQ==","shasum":"c3294d8670c014b13f5afb674050a0f3e3288c1c","tarball":"https://registry.npmjs.org/@akeraio/passport/-/passport-1.0.0.tgz","fileCount":12,"unpackedSize":13611,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCEuRCRA9TVsSAnZWagAA0WEP/jfMCEARpfPrPMMoBRuA\nM/41DVZiktb1k4v8QNqEo1/enXUXErBkI0NwPYK4o/2CdWlPWdSzhWnAawVZ\nWDGaVicNCDVmbKAyt3y6c9eNNfWHUiSD58JiajX1JJW6Y4k9NRkJlkoYXze9\nVlqp+aS/3FlR5xllM377D5gkQZbsQsHLyr+OUYn5hwGTvik0aPhSk7leAEnw\nN/yyvpmyO7CxJ/5eMXfDqkXvBKBix9OMMVve92f4dUYNWw7MvAr9mK1JDbbm\nJWozvn4dC0VPr8q9FJ9oE+MdzLdFd0AQhpKsSh4SPmeQt2dy1CazQfO8ZdRf\n3thC3ywkxP/IE53+ETDG6l7BnsAv6THr5TP0TdI9zgsgRrl8brucCx0jqWvg\nl73Fn8Ekyl+R+IwmEMiFczFfMsQb1cCr5OTfFmXK3V4b1JNIfuJZmXn6h4Hx\nPeWmHaaCLvFEoSk5vR+LiuJf46dRvk4rMxFQqoVscuD15C9g+QNokJ2DLVad\nwqBfRJne6qtdINtDUu5NyC93Cm3/TjzrP/uxZ8tp1kKNBzj3kmVJTdKBGK+6\nWVqBHbN26pJm5lIWxnVR+98n9B1QwPT1B1nMD4wLKJGX+fpXkYYFRiE2OI3w\ngo0Frt9z2yMH4UMdNubUvJB/Z0BJeegR6KRJjH9UDivF76Gv6Zro+LY6Djkr\nMkzW\r\n=CEHC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcLnTGZPe6vtQ8bEZ/6FUeGisuckU8TYF72W9cNgu3pQIhANT46AIgawNCdqCAiYX7YCys3PKoCBVF9xGiAxhUDF5s"}]},"maintainers":[{"name":"akeraio","email":"marian.edu@acorn.ro"}],"_npmUser":{"name":"akeraio","email":"marian.edu@acorn.ro"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/passport_1.0.0_1594379152807_0.648504757113965"},"_hasShrinkwrap":false}},"time":{"created":"2020-07-10T11:05:52.764Z","1.0.0":"2020-07-10T11:05:52.916Z","modified":"2022-04-04T12:29:08.256Z"},"maintainers":[{"name":"akeraio","email":"marian.edu@acorn.ro"}],"description":"Akera authentication strategy for Passport.","homepage":"https://github.com/akera-io/passport-akera#readme","keywords":["passport","akera","auth","authentication","identity"],"repository":{"type":"git","url":"git+https://github.com/akera-io/passport-akera.git"},"author":{"name":"Marian Edu","email":"marian.edu@acorn.ro"},"bugs":{"url":"https://github.com/akera-io/passport-akera/issues"},"license":{"type":"MIT","url":"https://github.com/akera-io/passport-akera/raw/master/LICENSE"},"readme":"# passport-akera\n\n[Passport](http://passportjs.org/) authentication strategy against Akera.io application server. \nThis module is a Passport strategy wrapper for [@akera/api](http://akera.io)\n\n## Install\n\n```\nnpm install @akeraio/passport\n```\n\n## Usage\n\n### Configure strategy\n\n**Typescript**\n```typescript\nimport {Strategy as AkeraStrategy} from \"@akeraio/passport\"; \nimport * as passport from \"passport\";\n\npassport.use(new AkeraStrategy({\n    server: {\n      host: 'localhost',\n      port: 8383,\n      useSSL: true\n    },\n    ...\n  }));\n```\n\n**Javascript**\n```javascript\nconst AkeraStrategy = require('@akeraio/passport').Strategy;\n\npassport.use(new AkeraStrategy({\n    server: {\n      host: 'localhost',\n      port: 8383,\n      useSSL: true\n    },\n    ...\n  }));\n```\n\n\n* `server`: Akera.io settings. These are passed directly to [@akera/api](http://akera.io) connect method. See its documentation for all available options.\n    * `host`: Akera.io application server host name or ip address, e.g. `localhost`\n    * `port`: Akera.io application server port number, e.g. `8383`\n    * `useSSL`: Akera.io application server SSL connection flag\n* `usernameField`: Field name where the user name is found, defaults to _username_\n* `passwordField`: Field name where the password is found, defaults to _password_\n* `passReqToCallback`: When `true`, `req` is the first argument to the verify callback (default: `false`):\n\n        passport.use(new AkeraStrategy(..., function(req, user, done) {\n            ...\n            done(null, user);\n          }\n        ));\n\nNote: you can pass a function instead of an object as `options`, see the [example below](#options-as-function)\n\n### Authenticate requests\n\nUse `passport.authenticate()`, specifying the `'akera'` strategy, to authenticate requests.\n\n#### `authenticate()` options\n\nIn addition to [default authentication options](http://passportjs.org/guide/authenticate/) the following flash message options are available for `passport.authenticate()`:\n\n * `badRequestMessage`: missing username/password (default: 'Missing credentials')\n * `invalidCredentials`: `InvalidCredentialsError` (default: error returned by akera-api connect)\n\n## Express example\n\n**Typescript**\n```typescript\nimport express                     from \"express\";\nimport passport                    from \"passport\";\nimport {json, urlencoded}          from \"body-parser\";\nimport {Strategy as AkeraStrategy} from \"@akeraio/passport\";\n\nconst OPTS = {\n  server: {\n    host: 'localhost',\n    port: '8383',\n    useSSL: true\n  }\n};\n\nconst app = express();\n\npassport.use(new AkeraStrategy(OPTS));\n\napp.use(json());\napp.use(urlencoded({extended: false}));\napp.use(passport.initialize());\n\napp.post('/login', passport.authenticate('akera', {session: false}), function(req, res) {\n  res.send({status: 'ok'});\n});\n\napp.listen(8080);\n```\n\n**Javascript**\n```javascript\nconst express      = require('express');\nconst passport     = require('passport');\nconst bodyParser   = require('body-parser');\nconst AkeraStrategy = require('passport-akera').Strategy;\n\nconst OPTS = {\n  server: {\n    host: 'localhost',\n    port: '8383',\n    useSSL: true\n  }\n};\n\nconst app = express();\n\npassport.use(new AkeraStrategy(OPTS));\n\napp.use(bodyParser.json());\napp.use(bodyParser.urlencoded({extended: false}));\napp.use(passport.initialize());\n\napp.post('/login', passport.authenticate('akera', {session: false}), function(req, res) {\n  res.send({status: 'ok'});\n});\n\napp.listen(8080);\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}