{"id":15839564,"url":"https://github.com/afeiship/rails_jwt_admin","last_synced_at":"2026-04-27T23:32:27.371Z","repository":{"id":56890595,"uuid":"317712800","full_name":"afeiship/rails_jwt_admin","owner":"afeiship","description":"Jwt admin gem.","archived":false,"fork":false,"pushed_at":"2026-02-14T14:32:53.000Z","size":133,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-14T22:38:04.239Z","etag":null,"topics":["admin","api","auth","authentication","engine","gem","jwt","rails","ruby","single-user","token"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/afeiship.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-02T01:17:02.000Z","updated_at":"2026-02-14T14:32:56.000Z","dependencies_parsed_at":"2022-08-20T15:20:52.347Z","dependency_job_id":null,"html_url":"https://github.com/afeiship/rails_jwt_admin","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/afeiship/rails_jwt_admin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Frails_jwt_admin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Frails_jwt_admin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Frails_jwt_admin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Frails_jwt_admin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afeiship","download_url":"https://codeload.github.com/afeiship/rails_jwt_admin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Frails_jwt_admin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32360110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"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":["admin","api","auth","authentication","engine","gem","jwt","rails","ruby","single-user","token"],"created_at":"2024-10-05T16:20:28.029Z","updated_at":"2026-04-27T23:32:27.366Z","avatar_url":"https://github.com/afeiship.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RailsJwtAdmin\n\u003e JWT-based authentication system for Rails admin panel.\n\n## Features\n- JWT token-based authentication\n- Admin user management\n- Secure API responses with consistent format\n- Easy installation and configuration\n\n## Installation\n\n1. Add the required gems to your Gemfile(If not already added):\n```ruby\n# decode/encode methods\ngem \"jwt\"\ngem \"bcrypt\"\n\n# normalize response\ngem \"rails_warp\"\ngem \"rails_jwt_admin\"\n```\n\n2. Run bundle install:\n```bash\nbundle install\n```\n\n3. Install the admin:\n```bash\nrails g rails_jwt_admin:install\n```\n\n4. Run database migration:\n```bash\nrails db:migrate\n```\n\n## Configuration\n\n1. Generate and edit your application credentials:\n```bash\nEDITOR=vim rails credentials:edit\n```\n\n2. Add your JWT secret key:\n```yaml\njwt_secret: \"your_secret_key_here\"\n```\n\n## Setup Admin User\n\nCreate an initial admin user:\n```ruby\nRailsJwtAdmin::User.create(\n  username: \"admin\", \n  email: \"admin@example.com\", \n  password: \"your_secure_password\", \n  password_confirmation: \"your_secure_password\"\n)\n```\n\n## API Usage\n- POST `/rails_jwt_admin/auth` - Authenticate and get token\n- GET `/rails_jwt_admin/me` - Get current user info\n\n### Authentication\nSend POST request to `/rails_jwt_admin/auth` with:\n- `username` - Admin username\n- `password` - Admin password\n\n### Response Format\nSuccessful authentication returns:\n```json\n{\n  \"success\": true,\n  \"code\": 200,\n  \"message\": null,\n  \"data\": {\n    \"token\": \"eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxfQ...\"\n  }\n}\n```\n\nGet current user returns:\n```json\n{\n  \"success\": true,\n  \"code\": 200,\n  \"message\": null,\n  \"data\": {\n    \"id\": 1,\n    \"username\": \"admin\",\n    \"email\": \"example@qq.com\"\n  }\n}\n```\n\nFailed authentication returns:\n```json\n{\n  \"success\": false,\n  \"code\": 401,\n  \"message\": \"Authentication failed\",\n  \"data\": null\n}\n```\n\n### Authorization\nInclude the token in your requests using the Authorization header:\n```\nAuthorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxfQ...\n```\n\n## Security Considerations\n\n- Use a strong, unique JWT secret key\n- Consider token expiration times for security\n- Store sensitive credentials using Rails encrypted credentials\n- Regularly update dependencies for security patches\n- Follow Rails security best practices for session management and CSRF protection\n\n## Development Resources\n- [Rails Engines Guide](https://guides.rubyonrails.org/engines.html)\n- [JWT Ruby Implementation](https://github.com/jwt/ruby-jwt)\n- [Rails Security Guide](https://guides.rubyonrails.org/security.html)\n\n## License\nThis gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Frails_jwt_admin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafeiship%2Frails_jwt_admin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Frails_jwt_admin/lists"}