{"id":15651137,"url":"https://github.com/unicodeveloper/csharp-jwt-authentication-sample","last_synced_at":"2026-03-02T23:36:24.911Z","repository":{"id":52918275,"uuid":"59439096","full_name":"unicodeveloper/Csharp-jwt-authentication-sample","owner":"unicodeveloper","description":"A C# API and GUI that supports username and password authentication with JWTs","archived":false,"fork":false,"pushed_at":"2016-05-23T00:16:01.000Z","size":24,"stargazers_count":34,"open_issues_count":1,"forks_count":11,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-06-22T22:40:17.594Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","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/unicodeveloper.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":"2016-05-22T23:25:38.000Z","updated_at":"2024-02-04T22:50:41.000Z","dependencies_parsed_at":"2022-08-23T23:01:20.261Z","dependency_job_id":null,"html_url":"https://github.com/unicodeveloper/Csharp-jwt-authentication-sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/unicodeveloper/Csharp-jwt-authentication-sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unicodeveloper%2FCsharp-jwt-authentication-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unicodeveloper%2FCsharp-jwt-authentication-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unicodeveloper%2FCsharp-jwt-authentication-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unicodeveloper%2FCsharp-jwt-authentication-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unicodeveloper","download_url":"https://codeload.github.com/unicodeveloper/Csharp-jwt-authentication-sample/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unicodeveloper%2FCsharp-jwt-authentication-sample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30025127,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T23:31:36.176Z","status":"ssl_error","status_checked_at":"2026-03-02T23:31:20.819Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-10-03T12:37:05.377Z","updated_at":"2026-03-02T23:36:24.860Z","avatar_url":"https://github.com/unicodeveloper.png","language":"C#","readme":"# Csharp JWT Authentication sample\n\nThis is a Csharp Web API that supports username and password authentication with JWTs and has APIs that return user information to the GUI client and vice-versa.\n\nEverything about the Csharp WEB API runs from the `Api` Directory.\n\nThe Desktop C# app runs from the `WpfClient` Directory.\n\n## Available APIs\n\n### User APIs\n\n#### POST `/users`\n\nYou can do a POST to `/users` to create a new user.\n\n```json\n{\n  \"username\": \"\u003cusername\u003e\",\n\n  \"firstname\": \"\u003cfirstname\u003e\",\n\n  \"middlename\": \"\u003cmiddlename\u003e\",\n\n  \"lastname\": \"\u003clastname\u003e\",\n\n  \"age\": \u003cage\u003e\n}\n```\n\nThe body must have:\n\n* `username`: The username\n* `password`: The password\n\nIt returns the following:\n\n```json\n{\n\n  \"id\": \"\u003cid\u003e\",\n\n  \"username\": \"\u003cusername\u003e\",\n\n  \"access_token\": \"\u003cjwt\u003e\"\n}\n```\n\nThat JWT will contain the `id`, `username` and an `expires` indicating when the token will expire.\n\n#### POST `/users/login`\n\nYou can do a POST to `/users/login` to log a user in.\n\nThe body must have:\n\n* `username`: The username\n* `password`: The password\n\nIt returns the following:\n\n```json\n{\n\n  \"id\": \"\u003cid\u003e\",\n\n  \"username\": \"\u003cusername\u003e\",\n\n  \"access_token\": \"\u003cjwt\u003e\"\n}\n```\n\nThat JWT will contain the `id`, `username` and an `expires` indicating when the token will expire.\n\n### User API\n\n#### GET `/api/users/{id}`\n\nWhere `id` is the Id of a user\n\nIt returns the complete user information\n\n```json\n{\n  \"id\": \"\u003cid\u003e\",\n  \"username\": \"\u003cusername\u003e\",\n\n  \"firstname\": \"\u003cfirstname\u003e\",\n\n  \"middlename\": \"\u003cmiddlename\u003e\",\n\n  \"lastname\": \"\u003clastname\u003e\",\n\n  \"age\": \u003cage\u003e\n}\n```\n\nThe JWT must be sent on the `Authorization` header as follows: `Authorization: \u003cjwt\u003e`\n\n## Running it\n\nJust clone the repository, and launch the solution in Visual Studio. That's it :).\nThis project was built using Visual Studio 2015.\n\n## Issue Reporting\n\nIf you have found a bug or if you have a feature request, please report them at this repository issues section.\n\n## Author\n\n[Prosper Otemuyiwa](https://twitter.com/unicodeveloper)\n\n## License\n\nThis project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funicodeveloper%2Fcsharp-jwt-authentication-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funicodeveloper%2Fcsharp-jwt-authentication-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funicodeveloper%2Fcsharp-jwt-authentication-sample/lists"}