{"_id":"@dediapp/federated-identity-service","_rev":"4-95799bc58aa482191257143bbaf3e434","name":"@dediapp/federated-identity-service","dist-tags":{"latest":"1.0.0"},"versions":{"0.0.1":{"name":"@dediapp/federated-identity-service","version":"0.0.1","keywords":["federation","identity","twake","service"],"author":{"name":"Jordy Cabannes","email":"jcabannes@dediapp.com"},"license":"AGPL-3.0-or-later","_id":"@dediapp/federated-identity-service@0.0.1","maintainers":[{"name":"dedidev","email":"dedimcomtr@gmail.com"}],"homepage":"https://ci.dediapp.com/publicgroup/oss/twake/tom-server","bugs":{"url":"https://ci.dediapp.com/publicgroup/oss/twake/tom-server/-/issues"},"dist":{"shasum":"5a444036dd46071808b9d761f4f394214862f7a4","tarball":"https://registry.npmjs.org/@dediapp/federated-identity-service/-/federated-identity-service-0.0.1.tgz","fileCount":14,"integrity":"sha512-0RzDVu5oDaCdGg1LdUy4Y79CEcQPCxekLQDgLRobDA/HWcw03ccPwtVbC6t0bTm10hazkV5uJe8H5dPqOAyHpw==","signatures":[{"sig":"MEUCIC47SWE1IZoqwRyJcHWC25C+CfujRvo9tQQX5pKmZ2wPAiEAv8DhpztiV68QuMA8LfVdSevQH5IDNkNxlUqZBAQ/sj8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29981},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{"import":"./dist/index.js"},"gitHead":"3e4caf7f582d650d2fc13cf4169fdd22ad6893d9","scripts":{"test":"LOG_TRANSPORTS=File LOG_FILE=/dev/null jest","build":"npm run build:lib && npm run build:example","start":"node example/federated-identity-service.js","build:lib":"rollup -c","build:example":"rollup -p @rollup/plugin-typescript -e express,@dediapp/federated-identity-service -m -o example/federated-identity-service.js example/federated-identity-service.ts"},"_npmUser":{"name":"dedidev","email":"dedimcomtr@gmail.com"},"repository":{"url":"https://ci.dediapp.com/publicgroup/oss/twake/tom-server.git","type":"git"},"_npmVersion":"11.6.1","description":"This is the Dedi Federated Identity Service","directories":{},"_nodeVersion":"22.20.0","dependencies":{"lodash":"^4.17.21","validator":"^13.15.0","ip-address":"^9.0.5","@dediapp/utils":"*","@dediapp/crypto":"*","@dediapp/logger":"*","express-validator":"^7.0.1","@dediapp/config-parser":"*","@dediapp/matrix-identity-server":"*"},"_hasShrinkwrap":false,"optionalDependencies":{"@crowdsec/express-bouncer":"^0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/federated-identity-service_0.0.1_1760528267051_0.6133327000119628","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@dediapp/federated-identity-service","version":"0.0.2","keywords":["federation","identity","dedi","service"],"author":{"name":"Jordy Cabannes","email":"dev@dediapp.com"},"license":"AGPL-3.0-or-later","_id":"@dediapp/federated-identity-service@0.0.2","maintainers":[{"name":"dedidev","email":"dedimcomtr@gmail.com"}],"homepage":"https://github.com/DediappDev/dedi-server","bugs":{"url":"https://github.com/DediappDev/dedi-server/-/issues"},"dist":{"shasum":"b7df87b571965f69a41d15d30faca0c62dea5036","tarball":"https://registry.npmjs.org/@dediapp/federated-identity-service/-/federated-identity-service-0.0.2.tgz","fileCount":14,"integrity":"sha512-dM9f2IowWKFyea8N1Lxs4eoA5lKMjD/yWdLwtn+sqroDHh/VZhZpITWry2/OhuiiJD9gP/lCeQ3EyHDxT2n3tw==","signatures":[{"sig":"MEUCIAgsBn5jXHkNMkBOgueKqFF/elHk1L4y8db9AKIjzAsLAiEAi+HrlDx7Uz6EwRPTGR9yriw3CeABs8W/Mo6n79/Hae8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29912},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{"import":"./dist/index.js"},"gitHead":"9368800f83dc344a760f33f3b5e5f534ff55be5e","scripts":{"test":"LOG_TRANSPORTS=File LOG_FILE=/dev/null jest","build":"npm run build:lib && npm run build:example","start":"node example/federated-identity-service.js","build:lib":"rollup -c","build:example":"rollup -p @rollup/plugin-typescript -e express,@dediapp/federated-identity-service -m -o example/federated-identity-service.js example/federated-identity-service.ts"},"_npmUser":{"name":"dedidev","email":"dedimcomtr@gmail.com"},"repository":{"url":"git+https://github.com/DediappDev/dedi-server.git","type":"git"},"_npmVersion":"11.6.1","description":"This is the Dedi Federated Identity Service","directories":{},"_nodeVersion":"22.20.0","dependencies":{"lodash":"^4.17.21","validator":"^13.15.0","ip-address":"^9.0.5","@dediapp/utils":"*","@dediapp/crypto":"*","@dediapp/logger":"*","express-validator":"^7.0.1","@dediapp/config-parser":"*","@dediapp/matrix-identity-server":"*"},"_hasShrinkwrap":false,"optionalDependencies":{"@crowdsec/express-bouncer":"^0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/federated-identity-service_0.0.2_1760538178101_0.8914502617829889","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@dediapp/federated-identity-service","version":"0.0.3","keywords":["federation","identity","dedi","service"],"author":{"name":"Jordy Cabannes","email":"dev@dediapp.com"},"license":"AGPL-3.0-or-later","_id":"@dediapp/federated-identity-service@0.0.3","maintainers":[{"name":"dedidev","email":"dedimcomtr@gmail.com"}],"homepage":"https://github.com/DediappDev/dedi-server","bugs":{"url":"https://github.com/DediappDev/dedi-server/-/issues"},"dist":{"shasum":"a15bc3bb88f6cbf6ae1d1acf553650225bb5dce3","tarball":"https://registry.npmjs.org/@dediapp/federated-identity-service/-/federated-identity-service-0.0.3.tgz","fileCount":2,"integrity":"sha512-Z16GjBW/WsMd/Swk5J/2YUfoCbu+QnEu+4UXQlWW+VDIvDRsIkFnHQ2CLDbf1wH2HrYulANdB5qwZEzyXaio3A==","signatures":[{"sig":"MEYCIQCbH0RV1tozZkfkdaxEwCgPpCQAryhUYjWE1an4y8CaUQIhALJOWLmB2vTTbH2UBvHIXVkyC9i+hNyPhIMTUl1Mt3J5","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6452},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{"import":"./dist/index.js"},"gitHead":"e31e72286ee5d2fe0df4f468f17cd918474adaa7","scripts":{"test":"LOG_TRANSPORTS=File LOG_FILE=/dev/null jest","build":"npm run build:lib && npm run build:example","start":"node example/federated-identity-service.js","build:lib":"rollup -c","build:example":"rollup -p @rollup/plugin-typescript -e express,@dediapp/federated-identity-service -m -o example/federated-identity-service.js example/federated-identity-service.ts"},"_npmUser":{"name":"dedidev","email":"dedimcomtr@gmail.com"},"repository":{"url":"git+https://github.com/DediappDev/dedi-server.git","type":"git"},"_npmVersion":"11.6.1","description":"This is the Dedi Federated Identity Service","directories":{},"_nodeVersion":"22.20.0","dependencies":{"lodash":"^4.17.21","validator":"^13.15.0","ip-address":"^9.0.5","@dediapp/utils":"*","@dediapp/crypto":"*","@dediapp/logger":"*","express-validator":"^7.0.1","@dediapp/config-parser":"*","@dediapp/matrix-identity-server":"*"},"_hasShrinkwrap":false,"optionalDependencies":{"@crowdsec/express-bouncer":"^0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/federated-identity-service_0.0.3_1760539742913_0.5357173526199059","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@dediapp/federated-identity-service","version":"1.0.0","description":"This is the Dedi Federated Identity Service","keywords":["federation","identity","dedi","service"],"homepage":"https://github.com/DediappDev/dedi-server","bugs":{"url":"https://github.com/DediappDev/dedi-server/-/issues"},"repository":{"type":"git","url":"git+https://github.com/DediappDev/dedi-server.git"},"license":"AGPL-3.0-or-later","author":{"name":"Jordy Cabannes","email":"dev@dedim.com.tr"},"type":"module","exports":{"import":"./dist/index.js"},"main":"dist/index.js","types":"./dist/index.d.ts","scripts":{"build":"npm run build:lib && npm run build:example","build:example":"rollup -p @rollup/plugin-typescript -e express,@dediapp/federated-identity-service -m -o example/federated-identity-service.js example/federated-identity-service.ts","build:lib":"rollup -c","start":"node example/federated-identity-service.js","test":"LOG_TRANSPORTS=File LOG_FILE=/dev/null jest"},"dependencies":{"@dediapp/config-parser":"*","@dediapp/crypto":"*","@dediapp/logger":"*","@dediapp/matrix-identity-server":"*","@dediapp/utils":"*","express-validator":"^7.0.1","ip-address":"^9.0.5","lodash":"^4.17.21","validator":"^13.15.0"},"optionalDependencies":{"@crowdsec/express-bouncer":"^0.1.0"},"gitHead":"21eda165dc45e43d32319626d63ed893eb968f6d","_id":"@dediapp/federated-identity-service@1.0.0","_nodeVersion":"22.20.0","_npmVersion":"11.6.1","dist":{"integrity":"sha512-XMZ5IdOROdItVu4REfy2cAY6NpyYdD1r18+SI8Ee6mrxDBbc1IGH44J59esz3v3nmTnJU/3NtvSgiFVdiacwXg==","shasum":"7f4b9fa9caf3a31948327573fd83d194f8683bfa","tarball":"https://registry.npmjs.org/@dediapp/federated-identity-service/-/federated-identity-service-1.0.0.tgz","fileCount":14,"unpackedSize":29915,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGbAEy4RtSUPoG8iM4p7dkLArSRqFfxkvjidF3465+F6AiEAkpE8MDVMUXQ/8uWRwkWzNgtFQRZkez4GrEFLidaD3jw="}]},"_npmUser":{"name":"dedidev","email":"dedimcomtr@gmail.com"},"directories":{},"maintainers":[{"name":"dedidev","email":"dedimcomtr@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/federated-identity-service_1.0.0_1760567776454_0.076456798685413"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-15T11:37:46.942Z","modified":"2025-10-15T22:36:16.878Z","0.0.1":"2025-10-15T11:37:47.256Z","0.0.2":"2025-10-15T14:22:58.284Z","0.0.3":"2025-10-15T14:49:03.089Z","1.0.0":"2025-10-15T22:36:16.676Z"},"bugs":{"url":"https://github.com/DediappDev/dedi-server/-/issues"},"author":{"name":"Jordy Cabannes","email":"dev@dedim.com.tr"},"license":"AGPL-3.0-or-later","homepage":"https://github.com/DediappDev/dedi-server","keywords":["federation","identity","dedi","service"],"repository":{"type":"git","url":"git+https://github.com/DediappDev/dedi-server.git"},"description":"This is the Dedi Federated Identity Service","maintainers":[{"name":"dedidev","email":"dedimcomtr@gmail.com"}],"readme":"# @dediapp/federated-identity-service\n\nNode.js library that implements\n[Matrix Identity Service API](https://spec.matrix.org/v1.6/identity-service-api/) and [this proposal](https://github.com/guimard/matrix-spec-proposals/blob/unified-identity-service/proposals/4004-unified-identity-service-view.md)\n\n## Synopsis\n\nExample using [express](https://www.npmjs.com/package/express):\n\n```js\nimport express from 'express'\nimport FederatedIdentityService from '@dediapp/federated-identity-service'\n\n// if configuration is in default file (/etc/dedi/federated-identity-service.conf)\nconst federatedIdentityService = new FederatedIdentityService()\n\n// else if configuration is in a different file, set DEDI_FEDERATED_IDENTITY_SERVICE_CONF\nprocess.env.DEDI_FEDERATED_IDENTITY_SERVICE_CONF = '/path/to/config/file'\nconst federatedIdentityService = new FederatedIdentityService()\n\n// You can also give configuration directly\nconst federatedIdentityService = new FederatedIdentityService(config)\n\nconst app = express()\n\nfederatedIdentityService.ready.then( () => {\n  app.use(federatedIdentityService.routes)\n  app.listen(3000)\n})\n```\n\n## Configuration file\n\nConfiguration file is a JSON file. The default values are\nin [src/config.json](./src/config.json).\n\n## How to use it with a client\n\nSending requests to the federated identity service requires to be logged on this server. The token allowing to send requests to Tom-server does not work with the federated identity service.\n\nAfter the user signed in, the client has to send a GET request to `/.well-known/matrix/client` endpoint or `/.well-known/dedi/client` endpoint. If the response body contains the `m.federated_identity_services` key then at least one federated identity service is available. Keep the value of the `base_urls` field that you will find inside the `m.federated_identity_services` object.\n\nThese are the steps to obtain a token that works on the federated identity service:\n1. Send a POST request to the URL `https://<matrix_server_address>/_matrix/client/v3/user/<userId>/openid/request_token`, you have to replace `matrix_server_address` by the address of the Matrix server selected by the user, and `userId` by the Matrix id of the user. The request body has to be empty and you have to set the `Authorization` header with the value `Bearer <user_matrix_token>` where `user_matrix_token` is the token retrieved on sign in. For more details see [Matrix specification](https://spec.matrix.org/v1.8/client-server-api/#post_matrixclientv3useruseridopenidrequest_token). **NB**: The `access_token` given in response can be used to register into any Matrix identity service or to ask for a Token exchange into a [yadd/lemonldap-ng-portal](https://github.com/guimard/llng-docker) server\n2. The response body of the previous request now should be sent to the URL `https://<federated_identity_service>/_matrix/identity/v2/account/register`. `federated_identity_service` has to be replaced by each federated identity service address retrieved in the response body of the request sent on the first step. One request by federated identity service. The `Authorization` header does not need to be set. If the request does not work, maybe the value of  `matrix_server_name` in the body is not the good one.\nFor more details see [Matrix specification](https://spec.matrix.org/v1.8/identity-service-api/#post_matrixidentityv2accountregister)\n   * The response body JSON of each request will contain a `token` field whose the value will allow to be authenticated on the matching federated identity service.\n\n## Docker\n\n**Federation Identity Service** is available on [Docker](https://hub.docker.com/).\nYou can configure it using environment variables:\n\n* Required parameters:\n  * `TRUSTED_SERVERS_ADDRESSES`: the space separated list of Tom-Servers allowed\n    to push data. Networks or IP addresses\n  * `BASE_URL`; the public URL of this service _(example: https://fed-id-service.example.com/)_\n  * `DATABASE_ENGINE` _(`sqlite` or `pg`)_, `DATABASE_HOST`, `DATABASE_NAME`,\n    `DATABASE_USER`, `DATABASE_PASSWORD`: the database parameters\n* Optional parameters:\n  * `CRON_SERVICE` _(true/false)_: enable ot disable cron tasks. It is required\n    to have at least one active federated-odentity-service with `CRON_SERVICE`\n    active per database\n  * Logs:\n    * `LOG_TRANSPORTS`: set to `Console`\n    * `LOG_LEVEL`: default to \"error\", possible values: \"error\", \"warn\", \"info\", \"http\", \"verbose\", \"debug\", \"silly\"\n\nA federation server is also a [Matrix Identity Service](matrix-identity-server/README.md),\nthus all parameters of this service can also be enabled but this is interseting\nonly if this instance is also used as ToM-Server.\n\n## Copyright and license\n\nCopyright (c) 2023-present DediApp <https://dedim.com.tr>\n\nLicense: [GNU AFFERO GENERAL PUBLIC LICENSE](https://ci.dedim.com.tr/publicgroup/oss/dedi/dedi-server/-/blob/master/LICENSE)\n","readmeFilename":"README.md"}