{"_id":"@apchh/apc-auth-ngxs","_rev":"3-111db3e8ec59cb849db2ae40eee2d98f","name":"@apchh/apc-auth-ngxs","dist-tags":{"latest":"0.1.2"},"versions":{"0.0.1":{"name":"@apchh/apc-auth-ngxs","version":"0.0.1","peerDependencies":{"@angular/common":"^7.1.0","@angular/core":"^7.1.0","@ngxs/storage-plugin":"^3.3.4","@ngxs/store":"^3.3.4","jwt-decode":"^2.2.0"},"description":"This library's purpose is to make authentication of Angular 2+ applications fast an easy with a prebuilt, library that directly integrates with APC's authentication API. This Library is intended to be used with Angular Applications that arer set up using ","keywords":["apchh","angular","library","auth","ngxs"],"author":{"name":"Xavid Ramirez"},"license":"MIT","main":"bundles/apchh-apc-auth-ngxs.umd.js","module":"fesm5/apchh-apc-auth-ngxs.js","es2015":"fesm2015/apchh-apc-auth-ngxs.js","esm5":"esm5/apchh-apc-auth-ngxs.js","esm2015":"esm2015/apchh-apc-auth-ngxs.js","fesm5":"fesm5/apchh-apc-auth-ngxs.js","fesm2015":"fesm2015/apchh-apc-auth-ngxs.js","typings":"apchh-apc-auth-ngxs.d.ts","metadata":"apchh-apc-auth-ngxs.metadata.json","sideEffects":false,"dependencies":{"tslib":"^1.9.0"},"_id":"@apchh/apc-auth-ngxs@0.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"xavidram","email":"xavidram@gmail.com"},"dist":{"integrity":"sha512-0Rvbqtny4aMLdtFDe2Jp9fdkHmvyKonX/9Di9YTzTM5HpCscPwYNyN8ToWnILce+7steWA0hZVTVPKtznu5rag==","shasum":"92fbc5502c29e3baee64b324ca3c99433786e386","tarball":"https://registry.npmjs.org/@apchh/apc-auth-ngxs/-/apc-auth-ngxs-0.0.1.tgz","fileCount":74,"unpackedSize":400363,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcL3m+CRA9TVsSAnZWagAAHRIP/iUFbywzaBfrGc0A5Ugj\nvl2q3ObeLabeMWSYqOcRvzvawESGtAbn52QuFnT9xAHf3gUXVBJ30TalEYwh\nKGrMGtXcY35hVWJoV177DyQ1Y98o0LEbcU9yK2oUyWADlwS8DVQKigKBlLkO\nXZvRvG4fOmNyErA+sa93ko0JonELuKqPOuXbMpqHIEGr2yGc5d4UrGKg9Ma5\n9RcXFKJK+MeAOLxZ4SDlJ5IF9iLlM7R68gHM0FcOD1OfkZKrqYcbg+rg9O/A\nrEka/KlYnQqQHRAMjt4PyLqSyzb+4VWgsIQ7u3G01YCrKjlP5BJES8j+/x/l\nWjTNsL40+iJyeVe9LPk2k6+j4STK2VKaay8rjp8IzPAd3OqFkYMh/LrRGeHj\nit+nBK330zb1P/he/9uxaRvEL011NKiTnbCA7Cu3mdUtJhaL8z+aO0iLxYLO\nnYYnv5kM34vIsGWx2y841EZ1c5/nh5cDa0iJ48Aa7fr5meo2I1zxS6DB/syk\nO1vZad8Z13PlsbrKilHQRaEQTFM2FPOQ4/U9wbg8CsU4WnVIg7AABupeb47C\nZE3oeEmWM6yOBMFpqbzzO9RRSd7yYknEgcM5HLz98e3E4I30wsXe1LL6ujtu\n0BYSyBUEse2MVCznzvcraPTwrlNFsDKAj4vhi9IDDqJGMoQYr62QlNtFeqkP\nknoa\r\n=kb7/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8SHnnf6m0mCLk2WWxYJ5Iw3wr27VTULoRbcsZCQPQzQIhALAry4QOK+0qOaMp+zbt5UFnUmmSqrisgCGKZWzifP4o"}]},"maintainers":[{"name":"xavidram","email":"xavidram@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apc-auth-ngxs_0.0.1_1546615229395_0.5597314482190994"},"_hasShrinkwrap":false},"0.1.0":{"name":"@apchh/apc-auth-ngxs","version":"0.1.0","peerDependencies":{"@angular/common":"^7.1.0","@angular/core":"^7.1.0","@ngxs/storage-plugin":"^3.3.4","@ngxs/store":"^3.3.4","jwt-decode":"^2.2.0"},"description":"This library's purpose is to make authentication of Angular 2+ applications fast an easy with a prebuilt, library that directly integrates with APC's authentication API. This Library is intended to be used with Angular Applications that arer set up using ","keywords":["apchh","angular","library","auth","ngxs"],"author":{"name":"Xavid Ramirez"},"license":"MIT","main":"bundles/apchh-apc-auth-ngxs.umd.js","module":"fesm5/apchh-apc-auth-ngxs.js","es2015":"fesm2015/apchh-apc-auth-ngxs.js","esm5":"esm5/apchh-apc-auth-ngxs.js","esm2015":"esm2015/apchh-apc-auth-ngxs.js","fesm5":"fesm5/apchh-apc-auth-ngxs.js","fesm2015":"fesm2015/apchh-apc-auth-ngxs.js","typings":"apchh-apc-auth-ngxs.d.ts","metadata":"apchh-apc-auth-ngxs.metadata.json","sideEffects":false,"dependencies":{"tslib":"^1.9.0"},"_id":"@apchh/apc-auth-ngxs@0.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"xavidram","email":"xavidram@gmail.com"},"dist":{"integrity":"sha512-HyL7VLeCEMD2MU/b6Bx1ojg6s+53SzaodhVLn5P+O0rqtv+/l/cLl1OIKemqTjyQi2/sCckicd28zjGVjPE+NA==","shasum":"857dc5ce58cfc9170264b69820ee5a653791b2a3","tarball":"https://registry.npmjs.org/@apchh/apc-auth-ngxs/-/apc-auth-ngxs-0.1.0.tgz","fileCount":74,"unpackedSize":400251,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPJuNCRA9TVsSAnZWagAAKxsP/i/Ko+bsvm1Xtw3Hb3Lw\nCS4raOOwP1s/QN5YClDvXM/t3T8kpaoWtVWfhFS6ZVICdzF5x5A6fd3UYp/f\nJnWBRT8HacPeqAFj1WQB9XZGn96q34dBVJB5L1OvicZck/zNMHHr6/ZwE32J\nFIa15/4BytPDZAg5WL07YVswGLao3xS2az8BZ6Os3fwhWRtqoMSDf0jotrUK\nSMwP/m5r3pRgnCmNft1k8tuafqGVJiGtZHNYMZ71Ioo1JU7oDS7iysB46TrG\nLbKfjjfEvNnAMBI23qKMZXx/XAkbNLatRZU2zDL1zzmnfvXIi4cC/esALc/M\n/rgbGDbCDwRduTT9VnS77gk38PXn/wr60jhOHR1x/72S1HCr7GgK0Jb0iUpO\nuGmfTQEtuPecNQUV7RL7n8+Xq0h2nWeob7JFpzSu6Cy0w3bIksNwIKMxqHEM\nFTivKv3ulYTgjSv+xx1RrBgNrpdwuHh3T4oetpO59Gneo8jryo0pnMNWr4BK\nkSFd7K5COYvTfP8vrG7/5Mm9kMA0qwBr6p9/65cU2K0hutI5VoCOiIe3S0lo\nzoZ+wh6Y0WPeZI7EnFEPK+JXz1N3+UjUJ5n1H15gQL4bPBXuL/V1ypiPd6qc\nRrHLYAhT3nJKeP7uMuGjnpNlKVr+GY0gdTJ7qpLBAkRSNWYOZ+ENjTAZoKWM\nfRbw\r\n=r9tL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD70MnP8s7s42FXjW59qw9xGZKIu2jBSBzEEaBHEdGTcwIgfEwuzYkSVvA/OKdEhjoMvhQMWMljX8jX4zfchVM0xyk="}]},"maintainers":[{"name":"xavidram","email":"xavidram@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apc-auth-ngxs_0.1.0_1547475852830_0.2840546163361246"},"_hasShrinkwrap":false},"0.1.2":{"name":"@apchh/apc-auth-ngxs","version":"0.1.2","peerDependencies":{"@angular/common":"^7.1.0","@angular/core":"^7.1.0","@ngxs/storage-plugin":"^3.3.4","@ngxs/store":"^3.3.4","jwt-decode":"^2.2.0"},"description":"This library's purpose is to make authentication of Angular 2+ applications fast an easy with a prebuilt, library that directly integrates with APC's authentication API. This Library is intended to be used with Angular Applications that arer set up using ","keywords":["apchh","angular","library","auth","ngxs"],"author":{"name":"Xavid Ramirez"},"license":"MIT","_id":"@apchh/apc-auth-ngxs@0.1.2","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"xavidram","email":"xavidram@gmail.com"},"dist":{"integrity":"sha512-6xTpl8wnJP7hs/CMibmsGxHvKD2vIkFb4+OG0X6t+hEESi5qwek/e3x7VTHnpzBcqlqpAISK5/0sJMJvgwBv1A==","shasum":"555bda0eee8f06d9ad9aa09e1e53d949d6276e0f","tarball":"https://registry.npmjs.org/@apchh/apc-auth-ngxs/-/apc-auth-ngxs-0.1.2.tgz","fileCount":36,"unpackedSize":27997,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRjUvCRA9TVsSAnZWagAAKvwP/inKwQoCJW2QeZrVLdD/\n10SuhJNs38NMUY4ByOWdLztuk6BBv54ETK+2PnReEXXEulzazoSOvhF+N3cy\n/fotf757vQO51BbOgjukvn6I+ksyxC/SVbTBvF0olHaiszbVP/8dP0Km/agX\ndkq5xLSB40ocMT4TkPAaZ9IZAOuB8ISGug4zy19+WddZQK6D4Nyni3eqWlBT\nhraoPXAqTXbPlyuALFb6YjcjyhcBRK1S4cAcAlP9VY6S4jL7A0R3DCLcB6ln\nX+KCB8K12FzuMuv2kgaFNDWoLL9ECMBHM4WlInzywQglhUFCIqmz4K6Hli5M\n7I9oa9r3BdybhocNyUa3GVDJ9BhQ+90S6feasG5hHyQcharmH9dbdtJVENFt\nfsPqLa3ojt/+Y5bmXcktHaslxfnKLK0TeIhsqgMjZkNP9Q0hFwkVKr9DV56j\noyjD0QgS8j143L//JI6pUcAmLgekUq9xqQsr3ZWXRhKjkEfUUM/MtEsOp/Cs\nREj4ENElEZUk6WYPLoyRPMpRO0vpf/ld82nyEpVBXotjXd+wPMwacFrLHtdL\n9iiWxBrcbmToZtut6dFzKj/NiAqa75MFuDDf5VYbIJzVkd3IWSH0N4nlKNzm\nR962JE8PXv89C8lhDJ8LtivMR6+QCUHJhch0zY6+sJ777PZ19KOaEt6ZFTGq\nLfJ4\r\n=t0S9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD8D2nlPhclAhH1zGI8J4cv9QC1QYpClDMDrMxvbXJUaQIhAI60QrQmB1ABhkDvwsE0cYd1qWgdSYj+v68zh1lM7WoD"}]},"maintainers":[{"name":"xavidram","email":"xavidram@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apc-auth-ngxs_0.1.2_1548105007045_0.8790944050320566"},"_hasShrinkwrap":false}},"time":{"created":"2019-01-04T15:20:29.223Z","0.0.1":"2019-01-04T15:20:29.538Z","modified":"2022-04-04T14:32:38.029Z","0.1.0":"2019-01-14T14:24:12.971Z","0.1.2":"2019-01-21T21:10:07.186Z"},"maintainers":[{"name":"xavidram","email":"xavidram@gmail.com"}],"description":"This library's purpose is to make authentication of Angular 2+ applications fast an easy with a prebuilt, library that directly integrates with APC's authentication API. This Library is intended to be used with Angular Applications that arer set up using ","keywords":["apchh","angular","library","auth","ngxs"],"author":{"name":"Xavid Ramirez"},"license":"MIT","readme":"# APC Authentication using NGXS\r\nThis library's purpose is to make authentication of Angular 2+ applications fast an easy with a prebuilt, library that directly integrates with APC's authentication API. This Library is intended to be used with Angular Applications that arer set up using the NGXS library for App State Managment.\r\n\r\n##### Peer dependencies\r\nThis project requires the following packages besides the default Angular packages.\r\n- `jwt-decode` - For decoding Json Web Tokens.\r\n- `@ngxs/store` - NGXS State Managment Library\r\n- `@ngxs/storage-plugin` - For managing Session Storage within the application.\r\n\r\n### Installation\r\nYou can add the package to your Angular application by either\r\n```sh\r\nnpm install --save @apchh/apc-auth-ngxs\r\n```\r\nor\r\n```sh\r\nyarn add @apchh/apc-auth-ngxs\r\n```\r\n\r\n##### Update your app.module.ts\r\nUpdate your `app.module.ts` file by integrating the code below into your pre-existing code.\r\n```sh\r\nconst appConf: IConfig = {\r\n    applicationId: 'apc applicationId'\r\n};\r\n\r\n@ngModule({\r\n    imports: [\r\n        APCAuthNGXSModule.forRoot(appConf)      \r\n    ],\r\n    providers: [AuthService]\r\n});\r\n```\r\nThe purpose of the `IConfig` typechecked variable is to specify to the Authentication library, an ApplicationId, and in the future, more application information that the Auth API will need to determine where the login requests are coming from, and properly authenticate the requests.\r\n\r\n##### Implementing Authentication Guards\r\nYou can use the Auth Guard within the APC-Auth-RXJS library to protect your routes by simply adding the `AuthGuard` to the `canActivate` route field. Then add a route to `login` using the `SignInComponent` provided by the library.\r\n```sh\r\nimport { AuthGuard, SignInComponent } from 'apc-auth-rxjs';\r\n\r\nconst routes: Routes = [\r\n    {\r\n        path: '',\r\n        component: HomeComponent,\r\n        canActivate: [AuthGuard]\r\n    }, {\r\n        path: 'login',\r\n        component: SignInComponent\r\n    }\r\n]\r\n```\r\n\r\n### Dev Tools\r\nDuring development, I would recommend you install the `@ngxs/devtools-plugin` and add it to your `app.module.ts` file. This plugin along with the `Redux Dev Tools Plugin` for your specific browser, will let you access a `Redux` tool in the Dev Tools section of your browser. With this plugin, your app will communicate with the browser's Dev Tools and display usefull Redux state managment information.\r\n\r\n### TODOs\r\n\r\n- Implement JWT Token Interceptors to verify active session\r\n- Implenent JWT Token Interceptor to append token to any and all requests\r\n- Questioning whether or not to make Registration and change user information components or leave that to developers.\r\n","readmeFilename":"README.md"}