{"_id":"@apihub24/token-authentication","_rev":"7-6dee9a658a80e6cea146402288d5d478","name":"@apihub24/token-authentication","dist-tags":{"latest":"2.0.0-alpha.0"},"versions":{"1.0.0":{"name":"@apihub24/token-authentication","version":"1.0.0","keywords":[],"author":{"url":"https://git.apihub24.de/","name":"Markus Morgenstern","email":"markusmorgenstern87@outlook.de"},"license":"MIT","_id":"@apihub24/token-authentication@1.0.0","maintainers":[{"name":"apihub24","email":"markusmorgenstern87@outlook.de"}],"dist":{"shasum":"61ceaf060d14edb25d3f5829caaefaa8ab71fe47","tarball":"https://registry.npmjs.org/@apihub24/token-authentication/-/token-authentication-1.0.0.tgz","fileCount":94,"integrity":"sha512-HbN4bumkGeJWVwRTWcNjphO36ljumQESCtY5kheEaBlOAoajqOOAP/cXq4afToIRZ9PJKdf5BPRlLU4uDKeICQ==","signatures":[{"sig":"MEYCIQCcS9olhABhWpTLtopM9laFF3wLWt9YFlGwYRaAP07YCwIhAINtfKqqHJpnYVqKGN9wYayNy8M+W/0t2398jStbqa/X","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":231112},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"70c35f6d2b6a78690887596fb89fbfb8f6005726","scripts":{"build":"tsc"},"_npmUser":{"name":"apihub24","email":"markusmorgenstern87@outlook.de"},"_npmVersion":"10.9.3","description":"This Package contains a Token Authentication Module for NestJs with Organizations UserAccounts Groups and Rights access.","directories":{},"_nodeVersion":"22.18.0","dependencies":{"@nestjs/core":"^11.1.6","@nestjs/common":"^11.1.6","@nestjs/config":"^4.0.2","class-validator":"^0.14.2","@apihub24/repository":"^1.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.2"},"_npmOperationalInternal":{"tmp":"tmp/token-authentication_1.0.0_1755722177923_0.44205926914255045","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@apihub24/token-authentication","version":"1.0.1","keywords":[],"author":{"url":"https://git.apihub24.de/","name":"Markus Morgenstern","email":"markusmorgenstern87@outlook.de"},"license":"MIT","_id":"@apihub24/token-authentication@1.0.1","maintainers":[{"name":"apihub24","email":"markusmorgenstern87@outlook.de"}],"dist":{"shasum":"9667cb68fa99c6f6fc72e9c210dd32a557d82e2f","tarball":"https://registry.npmjs.org/@apihub24/token-authentication/-/token-authentication-1.0.1.tgz","fileCount":94,"integrity":"sha512-cJHMu8kNSPbrtdQHtHHoRLP03pGQl126T23WQBYdieoWnyFPnUzuO9G8zDDtf9Qg1KAPd2Y+/vvffYpjzTSXtw==","signatures":[{"sig":"MEUCIQCBX5Fo+gLBPEmT/OAkRJKFV/CRT/HjliGJaTQDs6Li7wIgMqab1NhS5i+yKBRO5DYInbApnKc89kvDX/fo2fUvHRI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":231104},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"70c35f6d2b6a78690887596fb89fbfb8f6005726","scripts":{"build":"tsc"},"_npmUser":{"name":"apihub24","email":"markusmorgenstern87@outlook.de"},"_npmVersion":"10.9.3","description":"This Package contains a Token Authentication Module for NestJs with Organizations UserAccounts Groups and Rights access.","directories":{},"_nodeVersion":"22.18.0","dependencies":{"@nestjs/core":"^11.1.6","@nestjs/common":"^11.1.6","@nestjs/config":"^4.0.2","class-validator":"^0.14.2","@apihub24/repository":"^1.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.2"},"_npmOperationalInternal":{"tmp":"tmp/token-authentication_1.0.1_1755724457365_0.9738978412096715","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@apihub24/token-authentication","version":"1.0.2","keywords":[],"author":{"url":"https://git.apihub24.de/","name":"Markus Morgenstern","email":"markusmorgenstern87@outlook.de"},"license":"MIT","_id":"@apihub24/token-authentication@1.0.2","maintainers":[{"name":"apihub24","email":"markusmorgenstern87@outlook.de"}],"dist":{"shasum":"9f5930eadc39be556443de10cdb9423778330571","tarball":"https://registry.npmjs.org/@apihub24/token-authentication/-/token-authentication-1.0.2.tgz","fileCount":115,"integrity":"sha512-5z69aUultXkX1MrBYmaDrWCT21z0Zf29YFZdQwo/rmFb9yvT1d369PRkOwL/vTZTbdPieSWjagpJ6JgwEl3IxA==","signatures":[{"sig":"MEQCIGLz2R/NcvTPEs5sZ+44ejOnFirONhxI1fniwE7VshiaAiAbaaB7pPsd25RHPs6U1oZ8HL16yoTPeSb8E1jcGX22Ag==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":235762},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"b9f546d045dc0be3738061b3ad586358a3ff8e37","scripts":{"build":"tsc"},"_npmUser":{"name":"apihub24","email":"markusmorgenstern87@outlook.de"},"_npmVersion":"10.9.3","description":"This Package contains a Token Authentication Module for NestJs with Organizations UserAccounts Groups and Rights access.","directories":{},"_nodeVersion":"22.18.0","dependencies":{"@nestjs/core":"^11.1.6","@nestjs/common":"^11.1.6","@nestjs/config":"^4.0.2","class-validator":"^0.14.2","@apihub24/repository":"^1.0.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.2"},"_npmOperationalInternal":{"tmp":"tmp/token-authentication_1.0.2_1755770864539_0.4796010428798534","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@apihub24/token-authentication","version":"1.0.3","keywords":[],"author":{"url":"https://git.apihub24.de/","name":"Markus Morgenstern","email":"markusmorgenstern87@outlook.de"},"license":"MIT","_id":"@apihub24/token-authentication@1.0.3","maintainers":[{"name":"apihub24","email":"markusmorgenstern87@outlook.de"}],"dist":{"shasum":"cd46bd4ffcb55c0747ff5850096c4be44296f0bc","tarball":"https://registry.npmjs.org/@apihub24/token-authentication/-/token-authentication-1.0.3.tgz","fileCount":115,"integrity":"sha512-lBMBKCF5Bpm9kdqyJ+0wpuQ2aaZpoY5Sk8ednQazAVv+HMLiI85fW9a+Ygzw1iM66d84213KYkTQVWcJZjqJwQ==","signatures":[{"sig":"MEUCIDooOLVPxQT4F8Hc+pLbczBijD7jYf90Lgtg5VzjhvtwAiEA++3JUJtyOqQK4jAv+nxOatoUZ9y0ZtodQVJ1POP6xHc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":301182},"jest":{"roots":["<rootDir>/src/"],"rootDir":".","testRegex":".*\\.spec\\.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"testEnvironment":"node","moduleNameMapper":{},"coverageDirectory":"./coverage","collectCoverageFrom":["**/*.(t|j)s"],"moduleFileExtensions":["js","json","ts"]},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"8471ff8eaf98c2149bc634d8ab2f385cc9a91154","scripts":{"pub":"npm publish","rel":"npm i && npm run build && npm run test:coverage","test":"jest","build":"tsc","test:coverage":"jest --coverage"},"_npmUser":{"name":"apihub24","email":"markusmorgenstern87@outlook.de"},"_npmVersion":"10.9.3","description":"This Package contains a Token Authentication Module for NestJs with Organizations UserAccounts Groups and Rights access.","directories":{},"_nodeVersion":"22.18.0","dependencies":{"@nestjs/core":"^11.1.6","@nestjs/common":"^11.1.6","@nestjs/config":"^4.0.2","class-validator":"^0.14.2","@apihub24/repository":"^1.0.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.0.0","ts-jest":"^29.4.1","typescript":"^5.9.2","@types/jest":"^30.0.0","@nestjs/testing":"^11.1.6"},"_npmOperationalInternal":{"tmp":"tmp/token-authentication_1.0.3_1755802402014_0.4615587296031811","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@apihub24/token-authentication","version":"1.0.4","keywords":[],"author":{"url":"https://git.apihub24.de/","name":"Markus Morgenstern","email":"markusmorgenstern87@outlook.de"},"license":"MIT","_id":"@apihub24/token-authentication@1.0.4","maintainers":[{"name":"apihub24","email":"markusmorgenstern87@outlook.de"}],"dist":{"shasum":"c3df2f8fa61462b2ef2015bfde80c5c88239fec1","tarball":"https://registry.npmjs.org/@apihub24/token-authentication/-/token-authentication-1.0.4.tgz","fileCount":106,"integrity":"sha512-4v572LBbk9mDAthrYcI7wbm45gVki2GvZJUCKZPG7fYjR33M67+JtaVaLHy5jQ47QtOo1FF7cdF69wEq6nnn1g==","signatures":[{"sig":"MEYCIQC4IxMwToJK6c/bZmjooZ5kn74TohG/R3W/MH1c3eLAgQIhANpYdCkmEHIQl8PM6PaVf3noxFJWul1jcUlsfxKyBiOO","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":295775},"jest":{"roots":["<rootDir>/src/"],"rootDir":".","testRegex":".*\\.spec\\.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"testEnvironment":"node","moduleNameMapper":{},"coverageDirectory":"./coverage","collectCoverageFrom":["**/*.(t|j)s"],"moduleFileExtensions":["js","json","ts"]},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"81b9e4dd6865539427c8bb616cd6ac0c1be94b8f","scripts":{"pub":"npm publish","rel":"npm i && npm run build && npm run test:coverage","test":"jest","build":"rimraf ./dist && tsc","test:coverage":"jest --coverage"},"_npmUser":{"name":"apihub24","email":"markusmorgenstern87@outlook.de"},"_npmVersion":"10.9.3","description":"This Package contains a Token Authentication Module for NestJs with Organizations UserAccounts Groups and Rights access.","directories":{},"_nodeVersion":"22.18.0","dependencies":{"@nestjs/core":"^11.1.6","@nestjs/common":"^11.1.6","@nestjs/config":"^4.0.2","class-validator":"^0.14.2","@apihub24/repository":"^1.0.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.0.0","rimraf":"^6.0.1","ts-jest":"^29.4.1","typescript":"^5.9.2","@types/jest":"^30.0.0","@nestjs/testing":"^11.1.6"},"_npmOperationalInternal":{"tmp":"tmp/token-authentication_1.0.4_1755805980052_0.7258527042071756","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@apihub24/token-authentication","version":"1.0.5","keywords":[],"author":{"url":"https://git.apihub24.de/","name":"Markus Morgenstern","email":"markusmorgenstern87@outlook.de"},"license":"MIT","_id":"@apihub24/token-authentication@1.0.5","maintainers":[{"name":"apihub24","email":"markusmorgenstern87@outlook.de"}],"dist":{"shasum":"5d249b7a2190ca5da1f551ccf80f269ca4520647","tarball":"https://registry.npmjs.org/@apihub24/token-authentication/-/token-authentication-1.0.5.tgz","fileCount":106,"integrity":"sha512-TJux8b2MD4/kLRv3L5c8BF4FC2HFXNgOBJrMjWvlUAw9gzOlNzJjI2yyk+aQd+YcjpRwETY43TPTOyW8WSTT3w==","signatures":[{"sig":"MEUCIQDYVmuBaYzGn6xsBr0a4KObvHUwxKQvgvHehXZCioyglAIgGwDk3HeYoSD05SwKpsx7VHzGzK9RQSYOdv7GYSHiBI8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":301551},"jest":{"roots":["<rootDir>/src/"],"rootDir":".","testRegex":".*\\.spec\\.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"testEnvironment":"node","moduleNameMapper":{},"coverageDirectory":"./coverage","collectCoverageFrom":["**/*.(t|j)s"],"moduleFileExtensions":["js","json","ts"]},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"7bc047b4da8cf888a11e3bffcb636e6d5b2492b1","scripts":{"pub":"npm publish","rel":"npm i && npm run build && npm run test:coverage","test":"jest","build":"rimraf ./dist && tsc","test:coverage":"jest --coverage"},"_npmUser":{"name":"apihub24","email":"markusmorgenstern87@outlook.de"},"_npmVersion":"10.9.3","description":"This Package contains a Token Authentication Module for NestJs with Organizations UserAccounts Groups and Rights access.","directories":{},"_nodeVersion":"22.18.0","dependencies":{"@nestjs/core":"^11.1.6","@nestjs/common":"^11.1.6","@nestjs/config":"^4.0.2","class-validator":"^0.14.2","class-transformer":"^0.5.1","@apihub24/repository":"^1.0.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.0.0","rimraf":"^6.0.1","ts-jest":"^29.4.1","typescript":"^5.9.2","@types/jest":"^30.0.0","@nestjs/testing":"^11.1.6"},"_npmOperationalInternal":{"tmp":"tmp/token-authentication_1.0.5_1755810864616_0.0463645375028916","host":"s3://npm-registry-packages-npm-production"}},"2.0.0-alpha.0":{"name":"@apihub24/token-authentication","version":"2.0.0-alpha.0","description":"This Package contains a Token Authentication Module for NestJs with Organizations UserAccounts Groups and Rights access.","main":"dist/index.js","types":"./dist/index.d.ts","scripts":{"build":"rimraf ./dist && tsc","test":"jest","test:watch":"jest --watch","test:coverage":"jest --coverage","pub":"npm publish","rel":"npm i && npm run build && npm run test:coverage"},"dependencies":{"@nestjs/common":"^11.1.6","@nestjs/config":"^4.0.2","@nestjs/core":"^11.1.6","@apihub24/authentication":"2.0.0-alpha.0","@apihub24/repository":"^1.0.3","@apihub24/translation":"^1.0.1","class-validator":"^0.14.2","class-transformer":"^0.5.1"},"devDependencies":{"rimraf":"^6.0.1","@nestjs/testing":"^11.1.6","typescript":"^5.9.2","@types/jest":"^30.0.0","jest":"^30.0.0","ts-jest":"^29.4.1"},"keywords":[],"author":{"name":"Markus Morgenstern","email":"markusmorgenstern87@outlook.de","url":"https://git.apihub24.de/"},"license":"MIT","publishConfig":{"access":"public"},"jest":{"moduleFileExtensions":["js","json","ts"],"rootDir":".","testRegex":".*\\.spec\\.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"collectCoverageFrom":["**/*.(t|j)s"],"coverageDirectory":"./coverage","testEnvironment":"node","roots":["<rootDir>/src/"],"moduleNameMapper":{}},"_id":"@apihub24/token-authentication@2.0.0-alpha.0","gitHead":"1c5095eb9396d66956e2963af3251254407f9b79","_nodeVersion":"22.18.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-xGO8CHdQ86K+i5X5CiiAs+4gk3mja3aZZda1pTYyFHkgaW64mZ7MO9OA/lhVqtUnwf25bb+nkEBNUaZjLrYx6Q==","shasum":"a3424d65f6fe49e16134a8591a3660a6dd67aa46","tarball":"https://registry.npmjs.org/@apihub24/token-authentication/-/token-authentication-2.0.0-alpha.0.tgz","fileCount":81,"unpackedSize":302173,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGpwSv5SIyo9gHsyEqfyRkvBoXx72ESS2Bc+zAuposOrAiBQwWRPSVPn79pLSY1tQVkKGC8QxDmD0zMqTe6KVUgxJQ=="}]},"_npmUser":{"name":"apihub24","email":"markusmorgenstern87@outlook.de"},"directories":{},"maintainers":[{"name":"apihub24","email":"markusmorgenstern87@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/token-authentication_2.0.0-alpha.0_1756071677450_0.6092650142249834"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-20T20:36:17.819Z","modified":"2025-08-24T21:41:17.788Z","1.0.0":"2025-08-20T20:36:18.128Z","1.0.1":"2025-08-20T21:14:17.566Z","1.0.2":"2025-08-21T10:07:44.774Z","1.0.3":"2025-08-21T18:53:22.213Z","1.0.4":"2025-08-21T19:53:00.247Z","1.0.5":"2025-08-21T21:14:24.812Z","2.0.0-alpha.0":"2025-08-24T21:41:17.630Z"},"author":{"name":"Markus Morgenstern","email":"markusmorgenstern87@outlook.de","url":"https://git.apihub24.de/"},"license":"MIT","keywords":[],"description":"This Package contains a Token Authentication Module for NestJs with Organizations UserAccounts Groups and Rights access.","maintainers":[{"name":"apihub24","email":"markusmorgenstern87@outlook.de"}],"readme":"# Token Authentication\r\n\r\nThis Package contains a Token Authentication Module for NestJs with Organizations UserAccounts Groups and Rights access.\r\n\r\n## Required external Services\r\n\r\nYou have to implement these Interfaces and give the Implementations into the Dynamic Module.\r\n\r\n| Service                 | Injection Token                     | Interface in Contracts   | Description                                                    |\r\n| ----------------------- | ----------------------------------- | ------------------------ | -------------------------------------------------------------- |\r\n| Token Service           | @apihub24/token_service             | TokenService             | a Service that generates the Token for authentication          |\r\n| Password Service        | @apihub24/password_service          | PasswordService          | a Service that hash the Password                               |\r\n| Session Service         | @apihub24/session_service           | SessionService           | a Service that handles Session Get, Save, Delete Operations    |\r\n| Mail Service            | @apihub24/mail_verification_service | MailVerificationService  | a Service that handles Send Verify Mail and the verify Request |\r\n| Account Repository      | @apihub24/account_repository        | Repository<Account>      | a Service that handles Session Get, Save, Delete Operations    |\r\n| Group Repository        | @apihub24/group_repository          | Repository<Group>        | a Service that handles Session Get, Save, Delete Operations    |\r\n| Right Repository        | @apihub24/right_repository          | Repository<Right>        | a Service that handles Session Get, Save, Delete Operations    |\r\n| Organization Repository | @apihub24/organization_repository   | Repository<Organization> | a Service that handles Session Get, Save, Delete Operations    |\r\n\r\nIf you want to use a InMemory Repository you not have to implement itself you can use the package [@apihub24/in-memory-repository](https://www.npmjs.com/package/@apihub24/in-memory-repository).\r\n\r\n## Example\r\n\r\n```typescript\r\nimport { Module } from \"@nestjs/common\";\r\nimport {\r\n  Account,\r\n  Group,\r\n  Organization,\r\n  Right,\r\n  TokenAuthenticationModule,\r\n} from \"@apihub24/token-authentication\";\r\nimport { LoginController } from \"./controllers/login.controller\";\r\nimport { LogoutController } from \"./controllers/logout.controller\";\r\nimport { ConfigModule } from \"@nestjs/config\";\r\n// a implementation of the EmailService\r\nimport { EmailVerificationModule } from \"@apihub24/email-verification\";\r\n// a implementation of the InMemoryRepository used for Repositories\r\nimport { InMemoryRepository } from \"@apihub24/in-memory-repository\";\r\n// a implementation of the SessionService\r\nimport { InMemorySessionsModule } from \"@apihub24/in-memory-sessions\";\r\n// a implementation of the TokenService\r\nimport { JwtGeneratorModule } from \"@apihub24/jwt-generator\";\r\n// a implementation of the PasswordService\r\nimport { PasswordHasherModule } from \"@apihub24/password-hasher\";\r\nimport { takeExportedProviders } from \"@apihub24/nestjs-helper\";\r\n\r\n// use the Dynamic Modules from the Implementations\r\nconst emailVerificationModule = EmailVerificationModule.forRoot();\r\nconst sessionModule = InMemorySessionsModule.forRoot();\r\n// JwtGeneratorModule requires the SessionModule so give them the Providers\r\nconst jwtModule = JwtGeneratorModule.forRoot([\r\n  ...takeExportedProviders(sessionModule),\r\n]);\r\nconst passwordModule = PasswordHasherModule.forRoot();\r\n\r\n@Module({\r\n  imports: [\r\n    ConfigModule.forRoot(),\r\n    EmailVerificationModule.forRoot(),\r\n    InMemorySessionsModule.forRoot(),\r\n    JwtGeneratorModule.forRoot(),\r\n    PasswordHasherModule.forRoot(),\r\n    TokenAuthenticationModule.forRoot(),\r\n  ],\r\n  controllers: [LoginController, LogoutController],\r\n  providers: [\r\n    // register the Repositories with InMemoryRepository\r\n    {\r\n      provide: \"@apihub24/organization_repository\",\r\n      useClass: InMemoryRepository<Organization>,\r\n    },\r\n    {\r\n      provide: \"@apihub24/account_repository\",\r\n      useClass: InMemoryRepository<Account>,\r\n    },\r\n    {\r\n      provide: \"@apihub24/group_repository\",\r\n      useClass: InMemoryRepository<Group>,\r\n    },\r\n    {\r\n      provide: \"@apihub24/right_repository\",\r\n      useClass: InMemoryRepository<Right>,\r\n    },\r\n  ],\r\n  // required exports for the TokenGuard\r\n  exports: [TokenAuthenticationModule, jwtModule],\r\n})\r\nexport class AuthenticationModule {}\r\n```\r\n","readmeFilename":"README.md"}