{"id":17001284,"url":"https://github.com/zemuldo/authentication-methods","last_synced_at":"2026-05-19T09:06:45.061Z","repository":{"id":88309603,"uuid":"333969355","full_name":"zemuldo/authentication-methods","owner":"zemuldo","description":null,"archived":false,"fork":false,"pushed_at":"2021-03-09T18:59:11.000Z","size":25,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-14T20:08:59.593Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zemuldo.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-28T22:09:41.000Z","updated_at":"2021-03-09T18:59:13.000Z","dependencies_parsed_at":"2023-04-27T21:33:42.033Z","dependency_job_id":null,"html_url":"https://github.com/zemuldo/authentication-methods","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/zemuldo/authentication-methods","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zemuldo%2Fauthentication-methods","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zemuldo%2Fauthentication-methods/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zemuldo%2Fauthentication-methods/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zemuldo%2Fauthentication-methods/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zemuldo","download_url":"https://codeload.github.com/zemuldo/authentication-methods/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zemuldo%2Fauthentication-methods/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33209476,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-19T07:54:09.561Z","status":"ssl_error","status_checked_at":"2026-05-19T07:54:08.508Z","response_time":58,"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":[],"created_at":"2024-10-14T04:24:24.834Z","updated_at":"2026-05-19T09:06:45.045Z","avatar_url":"https://github.com/zemuldo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zemuldo-authentication-methods\n\nTo start, clone repo then:\n Run `npm install`\n Run `npm start`\n\n## Basic Auth\nCall endpoint with credentials.\nExample:\n```shell\ncurl --request GET \\\n  --url http://localhost:4000/basic \\\n  --header 'Authorization: Basic emVtdWxkbzpwYXNzd29yZA=='\n```\n\n## Bearer Token\n\n### RS256\n\nRun auth request\n```shell\ncurl --request POST \\\n  --url http://localhost:4000/bearer-token/rsa-sha-256/signin \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n\t\"username\": \"zemuldo\",\n\t\"password\": \"password\"\n}'\n```\n\nResponse to this will look like\n\n```json\n{\n  \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2V...\"\n}\n```\n\nUse the token to call a protected endpoint\n\n```shell\ncurl --request GET \\\n  --url http://localhost:4000/bearer-token/rsa-sha-256/protected \\\n  --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1...'\n```\n\n### HS256\n\nLogin request\n```sehll\ncurl --request POST \\\n  --url http://localhost:4000/bearer-token/hmac-sha-256/signin \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n\t\"username\": \"zemuldo\",\n\t\"password\": \"password\"\n}'\n```\n\nResponse to this will look like\n\n```json\n{\n  \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2V...\"\n}\n```\n\nUse the token to access protected endpoint\n\n```shell\ncurl --request GET \\\n  --url http://localhost:4000/bearer-token/hmac-sha-256/protected \\\n  --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2...'\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzemuldo%2Fauthentication-methods","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzemuldo%2Fauthentication-methods","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzemuldo%2Fauthentication-methods/lists"}