{"_id":"@bluehalo/sof-strategy","_rev":"7-7f12b5cce9c1595d59cdc71afe303f56","name":"@bluehalo/sof-strategy","dist-tags":{"latest":"1.1.6"},"versions":{"1.1.6":{"name":"@bluehalo/sof-strategy","version":"1.1.6","author":{"name":"Robert-W","email":"rwinterbottom@asymmetrik.com"},"license":"MIT","_id":"@bluehalo/sof-strategy@1.1.6","maintainers":[{"name":"ashin-bluehalo","email":"andrew.shin@bluehalo.com"},{"name":"ekoon121","email":"ekoon@asymmetrik.com"},{"name":"reblace","email":"reblace@gmail.com"}],"homepage":"https://github.com/BlueHalo/node-fhir-server-core","dist":{"shasum":"e82ad2fb211672271f0885bd96f192e5579ccff6","tarball":"https://registry.npmjs.org/@bluehalo/sof-strategy/-/sof-strategy-1.1.6.tgz","fileCount":18,"integrity":"sha512-TfnoIyU0MmyjCl7eU7nuPMl0AT3L/AAP9Mo1VatGWUEj1k0VCaHhRPKvdrljVC1sVwH4I0yku9kPPny+ss2VAQ==","signatures":[{"sig":"MEQCIAT8p0DhjdJJrXaRliRzkqXgJFgqQ9H0oXhcf6Wwvu/IAiBSvTvRDVQpCtJ7Hlf/K3NL5YHvAnBzJOF8D+rflPuZfg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":63500},"main":"index.js","gitHead":"717c4ad053a5034563d778318b9ccb673d025930","scripts":{"test":"jest"},"_npmUser":{"name":"ashin-bluehalo","email":"andrew.shin@bluehalo.com"},"repository":{"type":"git","directory":"packages/sof-strategy"},"_npmVersion":"8.5.0","description":"Smart on FHIR authorization strategy for passport","directories":{},"_nodeVersion":"16.14.2","dependencies":{"superagent":"^6.1.0","passport-http-bearer":"^1.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sof-strategy_1.1.6_1708114055466_0.06444202862925508","host":"s3://npm-registry-packages"}}},"time":{"created":"2024-02-16T20:07:35.318Z","modified":"2026-03-25T20:11:03.015Z","1.1.6":"2024-02-16T20:07:35.610Z"},"author":{"name":"Robert-W","email":"rwinterbottom@asymmetrik.com"},"license":"MIT","homepage":"https://github.com/BlueHalo/node-fhir-server-core","repository":{"type":"git","directory":"packages/sof-strategy"},"description":"Smart on FHIR authorization strategy for passport","maintainers":[{"email":"reblace@gmail.com","name":"reblace"},{"email":"eugene.koon@bluehalo.com","name":"ekdeveloper"},{"email":"andrew.shin@bluehalo.com","name":"ashin-bluehalo"},{"email":"shane.oneill@bluehalo.com","name":"shane-bh"},{"email":"rnmercado@gmail.com","name":"rodmercad"}],"readme":"# SOF-Strategy\n\n> Strategy for Smart on FHIR authentication that works with Passport like any other passport strategy.\n\n## Install\n\n```shell\nyarn add @bluehalo/sof-strategy\n```\n\n## Usage\n\n```javascript\n// Returns a helper function to setup your strategy\nconst smartBearerStrategy = require('@bluehalo/sof-strategy');\nconst passport = require('passport');\n\n// Create our strategy by giving it some config options, all are required\nlet strategy = smartBearerStrategy({\n  introspectionUrl: 'https://www.foo.com/introspection',\n  clientSecret: 'secret',\n  clientId: 'client',\n});\n\n// Configure passport to use this new strategy\npassport.use(strategy);\n\n// Integrate it into your routes via middleware or some other mechanism\n// Our strategy is a bearer strategy so use bearer for the name\nlet name = 'bearer';\nlet options = { session: false };\n\n// Use as middleware use case\n// app is a express instance\napp.use('/some/protected/route/', passport.authenticate(name, options), someRouteController);\n```\n\nSee [sof-strategy tests](https://github.com/BlueHalo/node-fhir-server-core/tree/master/packages/sof-strategy/index.test.js) for more usage examples.\n\n## Arguments\n\n`@bluehalo/sof-strategy` exports a single function which takes a single options argument with the following properties.\n\n#### `introspectionUrl`\n\nIntrospection endpoint. The strategy will attempt to make a request to this endpoint with a token(provided by passport.js), clientId, clientSecret to validate the token has not been modified or resigned.\n\nType: `String`  \n Required: `true`\n\n#### `clientSecret`\n\nNecessary to validate the bearer token. Do not store these in client side code no matter what. This module should only be used server-side.\n\nType: `String`  \n Required: `true`\n\n#### `clientId`\n\nNecessary to validate the bearer token. Do not store these in client side code no matter what. This module should only be used server-side.\n\nType: `String`  \n Required: `true`\n","readmeFilename":"README.md"}