[{"data":1,"prerenderedAt":340},["ShallowReactive",2],{"catalog-module-auth-jwt":3},{"id":4,"category":5,"description":7,"documentation":8,"extension":9,"github":8,"icon":10,"interface":11,"meta":13,"name":14,"npm":15,"official":16,"repo":17,"sponsor":18,"stem":19,"__hash__":20,"stars":21,"downloads":22,"readme":23},"modules\u002Fcontent\u002Fmodules\u002Fauth-jwt.yml",[6],"Auth","Authentication and authorization module using JWT tokens","https:\u002F\u002Fgithub.com\u002FAntelopeJS\u002Fauth-jwt","yml","\u002Ficons\u002Fantelope.svg",[12],"auth",{},"auth-jwt","@antelopejs\u002Fauth-jwt",true,"antelopejs\u002Fauth-jwt",false,"content\u002Fmodules\u002Fauth-jwt","mYYBjtiGP5C4MQH3H70VJBuz0SlYazLdvWbDjrrnq3o",5,10449,{"data":24,"body":26,"toc":329},{"title":25,"description":25},"",{"type":27,"children":28},"root",[29,40,47,89,94,101,111,117,122,177,183,188,196,201,261,287,293,298,303,311,316],{"type":30,"tag":31,"props":32,"children":33},"element","p",{},[34],{"type":30,"tag":35,"props":36,"children":39},"img",{"alt":37,"src":38},"Auth JWT","https:\u002F\u002Fraw.githubusercontent.com\u002Fantelopejs\u002Fauth-jwt\u002Fmain\u002F.github\u002Fsocial-card.png",[],{"type":30,"tag":41,"props":42,"children":44},"h2",{"id":43},"antelopejsauth-jwt",[45],{"type":46,"value":15},"text",{"type":30,"tag":48,"props":49,"children":51},"div",{"align":50},"center",[52,62,71,80],{"type":30,"tag":53,"props":54,"children":56},"a",{"href":55},"https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@antelopejs\u002Fauth-jwt",[57],{"type":30,"tag":35,"props":58,"children":61},{"alt":59,"src":60},"NPM version","https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002F@antelopejs\u002Fauth-jwt.svg?style=for-the-badge&labelColor=000000",[],{"type":30,"tag":53,"props":63,"children":65},{"href":64},".\u002FLICENSE",[66],{"type":30,"tag":35,"props":67,"children":70},{"alt":68,"src":69},"License","https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fl\u002F@antelopejs\u002Fauth-jwt.svg?style=for-the-badge&labelColor=000000",[],{"type":30,"tag":53,"props":72,"children":74},{"href":73},"https:\u002F\u002Fdiscord.gg\u002FsjK28QHrA7",[75],{"type":30,"tag":35,"props":76,"children":79},{"src":77,"alt":78},"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDiscord-18181B?logo=discord&style=for-the-badge&color=000000","Discord",[],{"type":30,"tag":53,"props":81,"children":83},{"href":82},"https:\u002F\u002Fantelopejs.com\u002Fmodules\u002Fauth-jwt",[84],{"type":30,"tag":35,"props":85,"children":88},{"src":86,"alt":87},"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDocs-18181B?style=for-the-badge&color=000000","Documentation",[],{"type":30,"tag":31,"props":90,"children":91},{},[92],{"type":46,"value":93},"A flexible authentication and authorization module that implements the Auth interface of antelopejs with JWT.",{"type":30,"tag":95,"props":96,"children":98},"h3",{"id":97},"installation",[99],{"type":46,"value":100},"Installation",{"type":30,"tag":102,"props":103,"children":104},"pre",{},[105],{"type":30,"tag":106,"props":107,"children":108},"code",{},[109],{"type":46,"value":110},"ajs project modules add @antelopejs\u002Fauth-jwt\n",{"type":30,"tag":95,"props":112,"children":114},{"id":113},"interfaces",[115],{"type":46,"value":116},"Interfaces",{"type":30,"tag":31,"props":118,"children":119},{},[120],{"type":46,"value":121},"This module implements the Auth interface it can be integrated with your application to handle user authentication, token generation, verification, and access control. The interface is installed separately to maintain modularity and minimize dependencies.",{"type":30,"tag":123,"props":124,"children":125},"table",{},[126,148],{"type":30,"tag":127,"props":128,"children":129},"thead",{},[130],{"type":30,"tag":131,"props":132,"children":133},"tr",{},[134,140,145],{"type":30,"tag":135,"props":136,"children":137},"th",{},[138],{"type":46,"value":139},"Name",{"type":30,"tag":135,"props":141,"children":142},{},[143],{"type":46,"value":144},"Install command",{"type":30,"tag":135,"props":146,"children":147},{},[],{"type":30,"tag":149,"props":150,"children":151},"tbody",{},[152],{"type":30,"tag":131,"props":153,"children":154},{},[155,160,169],{"type":30,"tag":156,"props":157,"children":158},"td",{},[159],{"type":46,"value":6},{"type":30,"tag":156,"props":161,"children":162},{},[163],{"type":30,"tag":106,"props":164,"children":166},{"className":165},[],[167],{"type":46,"value":168},"ajs module imports add auth",{"type":30,"tag":156,"props":170,"children":171},{},[172],{"type":30,"tag":53,"props":173,"children":175},{"href":174},"https:\u002F\u002Fgithub.com\u002FAntelopeJS\u002Finterface-auth",[176],{"type":46,"value":87},{"type":30,"tag":95,"props":178,"children":180},{"id":179},"configuration",[181],{"type":46,"value":182},"Configuration",{"type":30,"tag":31,"props":184,"children":185},{},[186],{"type":46,"value":187},"The Auth module can be configured with the following options:",{"type":30,"tag":102,"props":189,"children":190},{},[191],{"type":30,"tag":106,"props":192,"children":193},{},[194],{"type":46,"value":195},"{\n  \"secret\": \"your-secret-key\",\n  \"signKey\": \"path-to-private-key-file\",\n  \"verifyKey\": \"path-to-public-key-file\",\n  \"signOptions\": {\n    \"expiresIn\": \"1h\",\n    \"algorithm\": \"RS256\"\n  },\n  \"verifyOptions\": {\n    \"ignoreExpiration\": false,\n    \"algorithms\": [\"RS256\"]\n  }\n}\n",{"type":30,"tag":31,"props":197,"children":198},{},[199],{"type":46,"value":200},"The configuration options include:",{"type":30,"tag":202,"props":203,"children":204},"ul",{},[205,217,228,239,250],{"type":30,"tag":206,"props":207,"children":208},"li",{},[209,215],{"type":30,"tag":106,"props":210,"children":212},{"className":211},[],[213],{"type":46,"value":214},"secret",{"type":46,"value":216},": A shared secret key used for both signing and verification (symmetric)",{"type":30,"tag":206,"props":218,"children":219},{},[220,226],{"type":30,"tag":106,"props":221,"children":223},{"className":222},[],[224],{"type":46,"value":225},"signKey",{"type":46,"value":227},": Path to a private key file (for asymmetric signing)",{"type":30,"tag":206,"props":229,"children":230},{},[231,237],{"type":30,"tag":106,"props":232,"children":234},{"className":233},[],[235],{"type":46,"value":236},"verifyKey",{"type":46,"value":238},": Path to a public key file (for asymmetric verification)",{"type":30,"tag":206,"props":240,"children":241},{},[242,248],{"type":30,"tag":106,"props":243,"children":245},{"className":244},[],[246],{"type":46,"value":247},"signOptions",{"type":46,"value":249},": Options for token signing (follows jsonwebtoken's SignOptions)",{"type":30,"tag":206,"props":251,"children":252},{},[253,259],{"type":30,"tag":106,"props":254,"children":256},{"className":255},[],[257],{"type":46,"value":258},"verifyOptions",{"type":46,"value":260},": Options for token verification (follows jsonwebtoken's VerifyOptions)",{"type":30,"tag":31,"props":262,"children":263},{},[264,266,271,273,278,280,285],{"type":46,"value":265},"Note: Either ",{"type":30,"tag":106,"props":267,"children":269},{"className":268},[],[270],{"type":46,"value":214},{"type":46,"value":272}," or both ",{"type":30,"tag":106,"props":274,"children":276},{"className":275},[],[277],{"type":46,"value":225},{"type":46,"value":279}," and ",{"type":30,"tag":106,"props":281,"children":283},{"className":282},[],[284],{"type":46,"value":236},{"type":46,"value":286}," must be provided.",{"type":30,"tag":95,"props":288,"children":290},{"id":289},"usage-with-api-controllers",[291],{"type":46,"value":292},"Usage with API Controllers",{"type":30,"tag":31,"props":294,"children":295},{},[296],{"type":46,"value":297},"As this module interfaces auth decorator with the interface API provider system, it can be used with API controllers.",{"type":30,"tag":31,"props":299,"children":300},{},[301],{"type":46,"value":302},"Authentication decorators can be used with any parameter in API controller methods. They can be combined with other parameters and decorators:",{"type":30,"tag":102,"props":304,"children":305},{},[306],{"type":30,"tag":106,"props":307,"children":308},{},[309],{"type":46,"value":310},"import { Controller, Get } from '@ajs\u002Fapi\u002Fbeta';\nimport { Authentication, AdminAuth } from '@ajs\u002Fauth\u002Fbeta';\n\nclass UsersController extends Controller('\u002Fusers') {\n  \u002F\u002F Accessible to all authenticated users\n  @Get()\n  async listUsers(@Authentication() user: any) {\n    \u002F\u002F List users\n    return { users: [] };\n  }\n}\n",{"type":30,"tag":95,"props":312,"children":314},{"id":313},"license",[315],{"type":46,"value":68},{"type":30,"tag":31,"props":317,"children":318},{},[319,321,327],{"type":46,"value":320},"This project is licensed under the Apache License 2.0 - see the ",{"type":30,"tag":53,"props":322,"children":324},{"href":323},"https:\u002F\u002Fraw.githubusercontent.com\u002Fantelopejs\u002Fauth-jwt\u002Fmain\u002FLICENSE",[325],{"type":46,"value":326},"LICENSE",{"type":46,"value":328}," file for details.",{"title":25,"searchDepth":330,"depth":330,"links":331},3,[332],{"id":43,"depth":333,"text":15,"children":334},2,[335,336,337,338,339],{"id":97,"depth":330,"text":100},{"id":113,"depth":330,"text":116},{"id":179,"depth":330,"text":182},{"id":289,"depth":330,"text":292},{"id":313,"depth":330,"text":68},1786370698367]