{"id":21800948,"url":"https://github.com/wpcodevo/go-postgres-jwt-auth-api","last_synced_at":"2026-04-20T03:33:14.373Z","repository":{"id":261261345,"uuid":"883775284","full_name":"wpcodevo/go-postgres-jwt-auth-api","owner":"wpcodevo","description":"In this article, you will learn how to implement authentication and role-based authorization in Golang using JSON Web Tokens (JWT).","archived":false,"fork":false,"pushed_at":"2024-11-07T23:05:29.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-26T03:41:16.639Z","etag":null,"topics":["authentication","authorization","fiber-framework","go","golang","gorm","jwt","postgresql"],"latest_commit_sha":null,"homepage":"https://codevoweb.com/json-web-token-authentication-and-authorization-in-golang/","language":"Go","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/wpcodevo.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":"2024-11-05T14:52:07.000Z","updated_at":"2024-11-07T23:07:27.000Z","dependencies_parsed_at":"2025-01-26T03:40:56.393Z","dependency_job_id":"977ee2f8-dc83-4124-9d8e-e32645cd180e","html_url":"https://github.com/wpcodevo/go-postgres-jwt-auth-api","commit_stats":null,"previous_names":["wpcodevo/go-postgres-jwt-auth-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpcodevo%2Fgo-postgres-jwt-auth-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpcodevo%2Fgo-postgres-jwt-auth-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpcodevo%2Fgo-postgres-jwt-auth-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpcodevo%2Fgo-postgres-jwt-auth-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wpcodevo","download_url":"https://codeload.github.com/wpcodevo/go-postgres-jwt-auth-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244752339,"owners_count":20504254,"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","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":["authentication","authorization","fiber-framework","go","golang","gorm","jwt","postgresql"],"created_at":"2024-11-27T11:15:19.647Z","updated_at":"2025-10-05T02:55:27.700Z","avatar_url":"https://github.com/wpcodevo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  JSON Web Token Authentication and Authorization in Golang\n\nIn this article, you will learn how to implement authentication and role-based authorization in Golang using JSON Web Tokens (JWT).\n\n![JSON Web Token Authentication and Authorization in Golang](https://codevoweb.com/wp-content/uploads/2024/11/JSON-Web-Token-Authentication-and-Authorization-in-Golang.webp)\n\n## Topics Covered\n\n- Run and Test the JWT Authentication and Authorization Flow in Golang\n- Bootstrap the Golang Project\n- Set up PostgreSQL and pgAdmin with Docker\n- Load Environment Variables into the Application\n- Connect the Application to the PostgreSQL Server\n- Create the User Model and Request Schemas\n- Implement Authentication Logic\n  - Sign Up User Route Handler\n  - Sign In User Route Handler\n  - Logout User Route Handler\n  - The Complete Auth Route Handlers\n- Create the Authentication Middleware\n- Implement Role-Based Authorization Middleware\n- Create User-Related Route Handlers\n  - Get Profile Information Route Handler\n  - Get Users Route Handler\n- Set up Routes for the Handlers\n- Register the Router and Configure CORS\n- Testing the JWT Authentication and Authorization Features of the API\n  - Sign Up\n  - Sign In\n  - Get Your Profile Information\n  - Admin Retrieve Users\n- Conclusion\n\n  \nRead the entire article here: [https://codevoweb.com/json-web-token-authentication-and-authorization-in-golang/](https://codevoweb.com/json-web-token-authentication-and-authorization-in-golang/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpcodevo%2Fgo-postgres-jwt-auth-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwpcodevo%2Fgo-postgres-jwt-auth-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpcodevo%2Fgo-postgres-jwt-auth-api/lists"}