{"id":41089,"library":"fintegrate-auth","title":"Fintegrate Auth","description":"The Auth package for Fintegrate ecosystem (v1.0.132, actively maintained, frequent releases) provides JWT-based authentication tools for NestJS applications. It integrates Passport strategies (JWT, local) with JWKS support via jwks-rsa. Key differentiators: pre-configured guards and decorators for Fintegrate microservices, automatic token refresh and validation against a JWKS endpoint. Compared to @nestjs/jwt+passport, it adds opinionated defaults for Fintegrate's API gateway pattern.","status":"active","version":"1.0.132","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","@fintegrate","typescript"],"install":[{"cmd":"npm install fintegrate-auth","lang":"bash","label":"npm"},{"cmd":"yarn add fintegrate-auth","lang":"bash","label":"yarn"},{"cmd":"pnpm add fintegrate-auth","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"RS256 JWT verification against JWKS endpoint","package":"jwks-rsa","optional":false},{"reason":"Core Passport authentication framework","package":"passport","optional":false},{"reason":"JWT strategy for Passport","package":"passport-jwt","optional":false},{"reason":"NestJS core module, required for guards and decorators","package":"@nestjs/core","optional":false},{"reason":"NestJS common utilities","package":"@nestjs/common","optional":false},{"reason":"Passport integration for NestJS","package":"@nestjs/passport","optional":false}],"imports":[{"note":"Named export, not default. ESM/CJS compatible.","wrong":"import AuthModule from 'fintegrate-auth';","symbol":"AuthModule","correct":"import { AuthModule } from 'fintegrate-auth';"},{"note":"Named export. Wrong: require returns module object, not the guard class directly.","wrong":"const JwtAuthGuard = require('fintegrate-auth');","symbol":"JwtAuthGuard","correct":"import { JwtAuthGuard } from 'fintegrate-auth';"},{"note":"Custom decorator, not from NestJS common. Typed with Fintegrate user interface.","wrong":"import { CurrentUser } from '@nestjs/common';","symbol":"CurrentUser","correct":"import { CurrentUser } from 'fintegrate-auth';"},{"note":"Service is re-exported from the package; do not import from internal paths.","wrong":"import { AuthService } from './auth/auth.service';","symbol":"AuthService","correct":"import { AuthService } from 'fintegrate-auth';"}],"quickstart":{"code":"// app.module.ts\nimport { Module } from '@nestjs/common';\nimport { AuthModule } from 'fintegrate-auth';\n\n@Module({\n  imports: [\n    AuthModule.register({\n      jwksUri: process.env.JWKS_URI ?? 'https://example.com/.well-known/jwks.json',\n      audience: process.env.AUDIENCE ?? 'my-api',\n      issuer: process.env.ISSUER ?? 'https://example.com/',\n    }),\n  ],\n})\nexport class AppModule {}\n\n// protected.controller.ts\nimport { Controller, Get, UseGuards } from '@nestjs/common';\nimport { JwtAuthGuard, CurrentUser } from 'fintegrate-auth';\n\n@Controller('protected')\nexport class ProtectedController {\n  @UseGuards(JwtAuthGuard)\n  @Get('profile')\n  getProfile(@CurrentUser() user: any) {\n    return user;\n  }\n}","lang":"typescript","description":"Shows registration of AuthModule with JWKS URI and usage of JwtAuthGuard and CurrentUser decorator in a NestJS controller."},"warnings":[{"fix":"Replace 'AuthModule.forRoot({...})' with 'AuthModule.register({...})'.","message":"The 'AuthModule.forRoot()' static method is deprecated, use 'AuthModule.register()' instead.","severity":"deprecated","affected_versions":"<=1.0.100"},{"fix":"If you relied on sub-only, change your controller to destructure the user object: 'getProfile(@CurrentUser() { sub }: any)'.","message":"In v1.0.0, the 'CurrentUser' parameter decorator returns the entire JWT payload; previously returned only the sub claim.","severity":"breaking","affected_versions":">=1.0.0 <1.0.50"},{"fix":"Always provide 'jwksUri' in the configuration object passed to 'AuthModule.register()'.","message":"If you do not configure 'jwksUri', the module throws at runtime: 'JWKS URI is required'. It is not optional.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Import 'JwtAuthGuard' instead of 'AuthGuard'.","message":"The 'AuthGuard' export (formerly 'AuthGuard') is deprecated, use 'JwtAuthGuard' instead.","severity":"deprecated","affected_versions":">=1.0.0 <=1.0.99"},{"fix":"Always pass audience as an array: audience: ['my-api'].","message":"Passing a string audience to 'register()' instead of a string array will cause mismatch if JWT contains audience as array.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'activ':10 'add':61 'api':67 'applic':22 'auth':2,4 'authent':18 'automat':47 'base':17 'compar':56 'configur':40 'decor':43 'default':63 'differenti':37 'ecosystem':8 'endpoint':55 'fintegr':1,7,45,65,71 'frequent':12 'gateway':68 'guard':41 'integr':24 'javascript':70 'jwks':30,34,54 'jwks-rsa':33 'jwt':16,27 'jwt-base':15 'key':36 'local':28 'maintain':11 'microservic':46 'nestj':21 'nestjs/jwt':58 'opinion':62 'packag':5 'passport':25,59 'pattern':69 'pre':39 'pre-configur':38 'provid':14 'refresh':49 'releas':13 'rsa':35 'strategi':26 'support':31 'token':48 'tool':19 'typescript':72 'v1.0.132':9 'valid':51 'via':32","created_at":"2026-06-04T18:50:43.369054+00:00","updated_at":"2026-06-04T18:50:43.369054+00:00","problems":[{"fix":"Provide jwksUri in the config object, e.g., AuthModule.register({ jwksUri: '...' }).","cause":"Missing or undefined jwksUri in AuthModule.register() configuration.","error":"Error: JWKS URI is required"},{"fix":"Ensure @UseGuards(JwtAuthGuard) is applied to the route and the JWT is valid.","cause":"The CurrentUser decorator returned undefined because the guard is not applied or the token is invalid.","error":"Cannot read properties of undefined (reading 'sub')"},{"fix":"Check that the JWT contains the expected audience and that the audience config matches exactly (string for single, array for multiple).","cause":"The JWT's audience claim does not match the configured audience in AuthModule.","error":"Error: audience mismatch"},{"fix":"Ensure passport and @nestjs/passport are installed and that PassportModule is imported before AuthModule.","cause":"Missing Passport installation or incorrect import order.","error":"TypeError: Passport.authenticate is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"fintegrate-auth","openapi_spec":null,"status_page":null,"smithery":null,"categories":["security"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}