{"id":23676839,"url":"https://github.com/smonn/dotnet-jwt-refresh","last_synced_at":"2026-04-26T20:32:24.384Z","repository":{"id":38076198,"uuid":"194012987","full_name":"smonn/dotnet-jwt-refresh","owner":"smonn","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-04T01:08:43.000Z","size":33,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-21T14:15:30.347Z","etag":null,"topics":["csharp","dotnet","example","jwt","refresh-token"],"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/smonn.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-27T03:01:41.000Z","updated_at":"2019-06-28T04:03:07.000Z","dependencies_parsed_at":"2025-02-19T18:41:31.297Z","dependency_job_id":"d5b54793-ca0e-4465-86e6-03f42df4a3c1","html_url":"https://github.com/smonn/dotnet-jwt-refresh","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/smonn/dotnet-jwt-refresh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smonn%2Fdotnet-jwt-refresh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smonn%2Fdotnet-jwt-refresh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smonn%2Fdotnet-jwt-refresh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smonn%2Fdotnet-jwt-refresh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smonn","download_url":"https://codeload.github.com/smonn/dotnet-jwt-refresh/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smonn%2Fdotnet-jwt-refresh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32312302,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T19:15:34.056Z","status":"ssl_error","status_checked_at":"2026-04-26T19:15:15.467Z","response_time":129,"last_error":"SSL_read: 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":["csharp","dotnet","example","jwt","refresh-token"],"created_at":"2024-12-29T14:56:29.348Z","updated_at":"2026-04-26T20:32:24.367Z","avatar_url":"https://github.com/smonn.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JWT login with refresh token\n\nExample of a .NET Core Web API using MongoDB with JWT authentication and support for refresh tokens.\n\n## Assumes these unique indexes are created\n\n```javascript\ndb.getCollection('accounts').createIndex(\n    { username: 1 },\n    { unique: true, background: true }\n);\ndb.getCollection('accounts').createIndex(\n    { email_address: 1 },\n    { unique: true, background: true }\n);\ndb.getCollection('refresh_tokens').createIndex(\n    { account_id: 1, value: 1 },\n    { unique: true, background: true }\n);\n```\n\n## Sample requests\n\n### Create a new account\n\n```http\nPOST https://localhost:5001/api/accounts\nContent-Type: application/json\n\n{\n    \"username\": \"alice\",\n    \"password\": \"t0ps3cret\",\n    \"surname\": \"Albright\",\n    \"given_name\": \"Alice\",\n    \"email_address\": \"alice.albright@example.com\"\n}\n```\n\n### Login\n\n```http\nPOST https://localhost:5001/api/login\nContent-Type: application/json\n\n{\n    \"username\": \"alice\",\n    \"password\": \"t0ps3cret\"\n}\n```\n\n### Refresh access token\n\n```http\nPOST https://localhost:5001/api/login/refresh\nContent-Type: application/json\n\n{\n    \"access_token\": \"\u003cACCESS_TOKEN_JWT\u003e\",\n    \"refresh_token\": \"\u003cREFRESH_TOKEN_RANDOM\u003e\"\n}\n```\n\n### Get account details\n\n```http\nGET https://localhost:5001/api/accounts\nAuthorization: Bearer \u003cACCESS_TOKEN_JWT\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmonn%2Fdotnet-jwt-refresh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmonn%2Fdotnet-jwt-refresh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmonn%2Fdotnet-jwt-refresh/lists"}