{"id":25365982,"url":"https://github.com/mikebridge/identityserver4signalr","last_synced_at":"2025-10-15T07:36:35.532Z","repository":{"id":137153638,"uuid":"83701630","full_name":"mikebridge/IdentityServer4SignalR","owner":"mikebridge","description":"Demo of Authentication SignalR with JWT Tokens via OpenID Connect in DotNet Core ","archived":false,"fork":false,"pushed_at":"2017-03-22T15:04:38.000Z","size":542,"stargazers_count":36,"open_issues_count":0,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-05T18:12:00.768Z","etag":null,"topics":["donet-core","identityserver4","openid-connect","react","signalr","typescript"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikebridge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-03-02T16:46:53.000Z","updated_at":"2024-09-09T12:58:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"b1501adb-8b7f-46e1-b4dc-e61568eec4d5","html_url":"https://github.com/mikebridge/IdentityServer4SignalR","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mikebridge/IdentityServer4SignalR","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikebridge%2FIdentityServer4SignalR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikebridge%2FIdentityServer4SignalR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikebridge%2FIdentityServer4SignalR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikebridge%2FIdentityServer4SignalR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikebridge","download_url":"https://codeload.github.com/mikebridge/IdentityServer4SignalR/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikebridge%2FIdentityServer4SignalR/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279059605,"owners_count":26094989,"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","status":"online","status_checked_at":"2025-10-15T02:00:07.814Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["donet-core","identityserver4","openid-connect","react","signalr","typescript"],"created_at":"2025-02-14T23:52:54.352Z","updated_at":"2025-10-15T07:36:35.504Z","avatar_url":"https://github.com/mikebridge.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"## IdentityServer4 and SignalR\r\n\r\nThis is an example of how to generate JWT tokens using \r\nIdentityServer4 and use them to authenticate users in SignalR via a React/TypeScript Single Page App.  \r\nIt will accompany [this blog post](https://mikebridge.github.io/articles/identityserver4-signalr/).\r\n\r\n### Prerequisites:\r\n\r\nYou can run this from the command line if you have Node and Dotnet Core installed,\r\nor you can use VS2015 or greater:\r\n\r\n- Install [Visual Studio 2015 Update 3](https://www.visualstudio.com/en-us/news/releasenotes/vs2015-update3-vs)\r\nand/or [DotNet Core 1.1](https://www.microsoft.com/net/download/core#/current).\r\n\r\n- Install [Node](https://nodejs.org/en/).  I'm using 6.9.5.\r\n\r\n- Optionally install the [Node extension for Visual Studio](https://www.visualstudio.com/vs/node-js/)\r\n\r\n## Create and Install Asymmetric Keys\r\n\r\nFrom the Developer Command Prompt:\r\n\r\n```\r\n\u003e makecert -n \"CN=ExampleTest\" -a sha256 -sv ExampleTest.pvk -r ExampleTest.cer\r\n\u003e pvk2pfx -pvk ExampleTest.pvk -spc ExampleTest.cer -pfx ExampleTest.pfx\r\n```\r\n\r\nThe pvk2pfx command combines the pvk and cer files into a single pfx file containing both the public and private \r\nkeys for the certificate. The IdentityServer4 app will use the private key from the pfx to sign tokens. \r\nThe .cer file containing the public key can be shared with other services for the purpose of signature validation.\r\n\r\nTo install asymmetric keys:\r\n\r\n1. Go to `Manage Computer Certificates` in Windows\r\n2. Under `Certificates - Local Computer =\u003e Personal =\u003e Certificates`, right click and select `All Tasks =\u003e Import...`\r\n3. Select `ExampleTest.pfx` and import it (there's no password).  You should see ExampleTest in the list.\r\n4. Under `Certificates - Local Computer =\u003e Trusted People =\u003e Certificates`, right click and select `All Tasks =\u003e Import...`\r\n5. Select `ExampleTest.cer` and import it (there's no password).\r\n\r\nIf you want to verify generated JWT tokens yourself at [jwt.io](https://jwt.io/), you can translate the .pfx to \r\na .pem file:\r\n\r\n```bash\r\nopenssl x509 -inform der -in ExampleTest.cer -pubkey -noout \u003e ExampleTest_pub.pem\r\n```\r\n\r\n### Launch from Command Line:\r\n\r\nFrom one console:\r\n\r\n```cmd\r\n\u003e cd src\\ChatAPI\r\n\u003e dotnet restore\r\n\u003e dotnet run\r\n```\r\n\r\nAnd in another console:\r\n\r\n```cmd\r\n\u003e cd src\\IdentityServer\r\n\u003e dotnet restore\r\n\u003e dotnet run\r\n```\r\n\r\nAnd in a third console:\r\n\r\n```cmd\r\n\u003e cd src\\Web\r\n\u003e npm install\r\n\u003e npm run start\r\n```\r\n\r\nIn a browser, navigate to [http://localhost:3000/](http://localhost:3000/).\r\n\r\nThe two test users are \"lou\" and \"bud\" with the password \"password\".\r\n\r\n## TODO\r\n\r\nI have not been able to get a net461 app working in docker using a nanoserver image.  \r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikebridge%2Fidentityserver4signalr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikebridge%2Fidentityserver4signalr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikebridge%2Fidentityserver4signalr/lists"}