{"id":15759366,"url":"https://github.com/jzo001/forge.security.jwt.client.web","last_synced_at":"2026-05-05T07:32:59.891Z","repository":{"id":62211771,"uuid":"557482600","full_name":"JZO001/Forge.Security.Jwt.Client.Web","owner":"JZO001","description":"Jwt Token authentication / authorization client side implementation for web apps","archived":false,"fork":false,"pushed_at":"2023-01-11T21:13:48.000Z","size":67,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-26T23:40:54.786Z","etag":null,"topics":["authentication","javascript","javascript-library","jwt","jwt-authentication","jwt-bearer-tokens","jwt-client","jwt-tokens","security","typescript","typescript-library"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JZO001.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-25T19:14:20.000Z","updated_at":"2022-11-01T11:45:24.000Z","dependencies_parsed_at":"2023-02-09T07:01:51.419Z","dependency_job_id":null,"html_url":"https://github.com/JZO001/Forge.Security.Jwt.Client.Web","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JZO001%2FForge.Security.Jwt.Client.Web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JZO001%2FForge.Security.Jwt.Client.Web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JZO001%2FForge.Security.Jwt.Client.Web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JZO001%2FForge.Security.Jwt.Client.Web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JZO001","download_url":"https://codeload.github.com/JZO001/Forge.Security.Jwt.Client.Web/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246443536,"owners_count":20778249,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","javascript","javascript-library","jwt","jwt-authentication","jwt-bearer-tokens","jwt-client","jwt-tokens","security","typescript","typescript-library"],"created_at":"2024-10-04T10:04:57.519Z","updated_at":"2026-05-05T07:32:59.857Z","avatar_url":"https://github.com/JZO001.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Forge.Security.Jwt.Client.Web\nJwt Token authentication / auothorization client side implementation for web apps\n\n\n## Installing\n\nTo install the package run npm package manager:\n\n```\nnpm install forge-xecurity-jwt-client-web --save\n```\n\n\n## Setup\n\nThe first step is to configurate the system. Normally the default values are ok.\n\n### Options\nThe options are available in class 'Options'.\n\na, TokenizedApiCommunicationServiceOptions\nAll settings for the 'fetch' requests.\n\n```\nOptions.getTokenizedApiCommunicationServiceOptions.mode = 'cors';\nOptions.getTokenizedApiCommunicationServiceOptions.cache = 'no-cache';\nOptions.getTokenizedApiCommunicationServiceOptions.credentials = 'same-origin';\nOptions.getTokenizedApiCommunicationServiceOptions.contentType = 'application/json';\nOptions.getTokenizedApiCommunicationServiceOptions.redirect = 'follow';\nOptions.getTokenizedApiCommunicationServiceOptions.referrerPolicy = 'no-referrer';\n```\n\nCheck this url for details: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch\n\n\nb, JwtClientAuthenticationCoreOptions\nSettings of authentication service (Url and Uri settings), etc\n\n```\n// Gets or sets the base address of the request. Leave it empty, if the current domain is used\nOptions.getJwtClientAuthenticationCoreOptions.baseAddress = \"\";\n\n// Default URI settings:\nOptions.getJwtClientAuthenticationCoreOptions.authenticationUri = \"api/auth/login\";\nOptions.getJwtClientAuthenticationCoreOptions.logoutUri = \"api/auth/logout\";\nOptions.getJwtClientAuthenticationCoreOptions.validateTokenUri = \"api/auth/validate-token\";\nOptions.getJwtClientAuthenticationCoreOptions.refreshUri = \"api/auth/refresh-token\";\n\n// Gets or sets the additional data for token generator. It is better, if the client can provider\n// more data, which is unique and help identify the client.\nOptions.getJwtClientAuthenticationCoreOptions.secondaryKeys = [];\n\n// Client side token refresh service will attempt to renew the accessToken before the expiry time reached\nOptions.getJwtClientAuthenticationCoreOptions.refreshTokenBeforeExpirationInMilliseconds = 15000;\n```\n\n### Services\n\nYou will optionally register the client-side storage for the given jwt token, to persist it for next time the browser starts with your web app.\n\n```c#\n// Use browser localStorage\nConfiguration.addLocalStorage();\n``` \n\nOr\n\n```c#\n// Use browser localStorage\nConfiguration.addSessionStorage();\n``` \n\nOr\n\n```c#\n// Use memory storage, which does not persist any information\n// This is the default, it does not neccessary to invoke it explicit\nConfiguration.addMemoryStorage();\n``` \n\nFinally, the additional services need to configured:\n\n```c#\nConfiguration.configureServices();\n``` \n\nFor a complete working example, please visit my Forge.Yoda repository: https://github.com/JZO001/Forge.Yoda\nThe solution conatins a project, called 'Forge.Yoda.Apps.Web.React'. Please feel free to check, how it is configured and used.\n\n\nPlease also check the following projects in my repositories:\n- Forge.Yoda\n- Forge.Security.Jwt.Service\n- Forge.Security.Jwt.Service.Storage.SqlServer\n- Forge.Security.Jwt.Client\n- Forge.Security.Jwt.Client.Storage.Browser\n- Forge.Wasm.BrowserStorages\n- Forge.Wasm.BrowserStorages.NewtonSoft.Json\n- Forge.Security.Jwt.Client.Web.React\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjzo001%2Fforge.security.jwt.client.web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjzo001%2Fforge.security.jwt.client.web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjzo001%2Fforge.security.jwt.client.web/lists"}