{"id":26925498,"url":"https://github.com/intellicode/authlite","last_synced_at":"2025-04-02T02:38:39.655Z","repository":{"id":282618309,"uuid":"948724793","full_name":"Intellicode/authlite","owner":"Intellicode","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-15T19:47:51.000Z","size":1,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T20:27:36.687Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/Intellicode.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":"2025-03-14T21:03:54.000Z","updated_at":"2025-03-15T19:47:54.000Z","dependencies_parsed_at":"2025-03-15T20:37:52.645Z","dependency_job_id":null,"html_url":"https://github.com/Intellicode/authlite","commit_stats":null,"previous_names":["intellicode/authlite"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intellicode%2Fauthlite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intellicode%2Fauthlite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intellicode%2Fauthlite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intellicode%2Fauthlite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Intellicode","download_url":"https://codeload.github.com/Intellicode/authlite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246745665,"owners_count":20826988,"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":[],"created_at":"2025-04-02T02:38:39.199Z","updated_at":"2025-04-02T02:38:39.641Z","avatar_url":"https://github.com/Intellicode.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AuthLite\n\nAuthLite is a lightweight OAuth2 provider implementation in Go. It provides a complete OAuth2 authorization server that can be used to secure your APIs and applications.\n\n## Features\n\n- OAuth2 authorization server implementation\n- Support for standard OAuth2 flows (authorization code, implicit, client credentials, password)\n- Authentication and session management\n- In-memory storage with interfaces for easy extension to persistent storage\n- Simple API for integration\n\n## Project Structure\n\nThe project follows the standard Go project layout:\n\n```\nauthlite/\n├── api/           # API definitions\n│   └── v1/        # API version 1\n├── cmd/           # Application entrypoints\n│   └── server/    # OAuth2 server command\n├── docs/          # Documentation\n├── examples/      # Example usage\n├── internal/      # Private application code\n│   ├── config/    # Configuration handling\n│   └── middleware/# HTTP middleware\n├── pkg/           # Public library code\n│   ├── auth/      # Authentication\n│   ├── oauth2/    # OAuth2 implementation\n│   └── storage/   # Storage interfaces\n└── web/          # Web assets (templates, static files)\n```\n\n## Getting Started\n\n### Prerequisites\n\n- Go 1.16 or higher\n\n### Installation\n\nClone the repository:\n\n```bash\ngit clone https://github.com/tom/authlite.git\ncd authlite\n```\n\n### Running the server\n\n```bash\ngo run cmd/server/main.go\n```\n\nThe server will start on `http://localhost:9000` by default.\n\n## Using the OAuth2 Provider\n\n### Register a client\n\nFor demonstration purposes, a test client is pre-registered with the following credentials:\n\n- Client ID: `test_client`\n- Client Secret: `test_secret`\n- Redirect URI: `http://localhost:8080/callback`\n\n### Authorization Code Flow\n\n1. Redirect the user to the authorization endpoint:\n\n```\nhttp://localhost:9000/oauth/authorize?client_id=test_client\u0026redirect_uri=http://localhost:8080/callback\u0026response_type=code\u0026scope=read\n```\n\n2. The user will be redirected to log in (use `testuser/password` for demo)\n3. After authorization, the user will be redirected to the specified redirect URI with an authorization code\n4. Exchange the authorization code for an access token:\n\n```bash\ncurl -X POST http://localhost:9000/oauth/token \\\n  -d \"grant_type=authorization_code\" \\\n  -d \"code=AUTHORIZATION_CODE\" \\\n  -d \"redirect_uri=http://localhost:8080/callback\" \\\n  -d \"client_id=test_client\" \\\n  -d \"client_secret=test_secret\"\n```\n\n### Using the Access Token\n\nUse the access token to access protected resources:\n\n```bash\ncurl -H \"Authorization: Bearer ACCESS_TOKEN\" http://localhost:9000/userinfo\n```\n\n## Next Steps\n\n- Implement persistent storage backends\n- Add support for JWT tokens\n- Add OpenID Connect extensions\n- Implement additional security features (PKCE, etc.)\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintellicode%2Fauthlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintellicode%2Fauthlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintellicode%2Fauthlite/lists"}