{"id":27959121,"url":"https://github.com/mohmdfo/casdoor-dify-plugin","last_synced_at":"2026-03-05T08:01:33.304Z","repository":{"id":281313503,"uuid":"944584461","full_name":"MohmdFo/casdoor-dify-plugin","owner":"MohmdFo","description":"A Dify plugin integrating Casdoor OAuth authentication via Flask, providing extension manifests and endpoints for seamless user authentication within the Dify ecosystem.","archived":false,"fork":false,"pushed_at":"2025-03-17T10:37:23.000Z","size":9427,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-01T10:45:07.446Z","etag":null,"topics":["ai","ai-agent","ai-agents","casdoor","dify","flask","oath","oath2","plugin","postgresql","python","redis","workflow"],"latest_commit_sha":null,"homepage":"","language":"Python","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/MohmdFo.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,"zenodo":null}},"created_at":"2025-03-07T15:53:40.000Z","updated_at":"2025-05-18T09:02:12.000Z","dependencies_parsed_at":"2025-05-07T18:48:07.160Z","dependency_job_id":null,"html_url":"https://github.com/MohmdFo/casdoor-dify-plugin","commit_stats":null,"previous_names":["mohmdfo/casdoor-dify-plugin"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MohmdFo/casdoor-dify-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MohmdFo%2Fcasdoor-dify-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MohmdFo%2Fcasdoor-dify-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MohmdFo%2Fcasdoor-dify-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MohmdFo%2Fcasdoor-dify-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MohmdFo","download_url":"https://codeload.github.com/MohmdFo/casdoor-dify-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MohmdFo%2Fcasdoor-dify-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30115662,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T03:40:26.266Z","status":"ssl_error","status_checked_at":"2026-03-05T03:39:15.902Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["ai","ai-agent","ai-agents","casdoor","dify","flask","oath","oath2","plugin","postgresql","python","redis","workflow"],"created_at":"2025-05-07T18:28:38.173Z","updated_at":"2026-03-05T08:01:33.224Z","avatar_url":"https://github.com/MohmdFo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Casdoor Dify Plugin\n\n## Overview\nThe Casdoor Dify Plugin integrates Casdoor OAuth-based authentication into the Dify ecosystem as an extension plugin. It provides endpoints to handle OAuth login, signup, and callback flows, enabling seamless user authentication via Casdoor.\n\n## Features\n- **OAuth Authentication:**  \n  Implements login, signup, and callback endpoints to facilitate the Casdoor OAuth flow.\n- **Dify Plugin Integration:**  \n  Uses a plugin manifest and endpoint YAML definitions to register the plugin with Dify.\n- **Environment-Based Configuration:**  \n  Loads sensitive credentials (certificates, client IDs, secrets, etc.) from a `.env` file.\n- **Local Testing with Flask:**  \n  Includes a Flask-based server (`main.py`) for local development and testing.\n\n## Project Structure\n```\n.\n├── GUIDE.md                   # Quick start guide for plugin development\n├── README.md                  # Project documentation\n├── _assets\n│   └── icon.svg               # Plugin icon asset\n├── endpoints\n│   ├── casdoor_auth.py         # Casdoor OAuth logic implementation\n│   ├── casdoor_login.yaml      # Endpoint manifest for login\n│   ├── casdoor_signup.yaml     # Endpoint manifest for signup\n│   └── casdoor_callback.yaml   # Endpoint manifest for callback\n├── main.py                    # Entry point for local testing (Flask server)\n├── manifest.yaml              # Plugin manifest for Dify integration\n└── requirements.txt           # Python dependencies list\n```\n\n## Prerequisites\n- **Python:** Version 3.12 or higher.\n- **Poetry:** For dependency management. ([Installation Guide](https://python-poetry.org/docs/))\n- **Dify Plugin Scaffolding Tool:** (Optional) For further development and testing on the Dify platform.\n- **Environment Variables:** A `.env` file containing your Casdoor credentials is required.\n\n## Installation\n1. **Clone the Repository:**\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd casdoor-dify-plugin\n   ```\n2. **Install Dependencies:**\n   ```bash\n   poetry install\n   ```\n\n## Configuration\nCreate a `.env` file in the project root and populate it with your Casdoor credentials:\n```env\n# Casdoor Configuration\nCASDOOR_CERT=\"-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----\"\nCASDOOR_ENDPOINT=https://your-casdoor-endpoint.example\nCASDOOR_CLIENT_ID=your_client_id\nCASDOOR_CLIENT_SECRET=your_client_secret\nCASDOOR_ORG_NAME=your_organization_name\nCASDOOR_APP_NAME=your_app_name\n\n# Installation Configuration\nINSTALL_METHOD=remote\nREMOTE_INSTALL_HOST=debug.dify.ai\nREMOTE_INSTALL_PORT=5003\nREMOTE_INSTALL_KEY=********-****-****-****-************\n\n# Database Configuration\nDB_USER=your_db_user\nDB_PASSWORD=your_db_password\nDB_HOST=your_db_host\nDB_PORT=your_db_port\nDB_NAME=your_db_name\n\n# Shared Secret for Generating Dify Tokens\nSECRET_KEY=your_secret_key\n\n# Redis Configuration\nREDIS_HOST=your_redis_host\nREDIS_PORT=your_redis_port\nREDIS_PASSWORD=your_redis_password\nREDIS_DB=your_redis_db\n\n```\n\n## Running the Plugin Locally\nFor local testing, run the Flask server with:\n```bash\npoetry run python main.py\n```\nThis starts the server on `http://0.0.0.0:8000`.\n\n## Testing the Endpoints\n- **Login Endpoint:**  \n  Navigate to [http://localhost:8000/casdoor/login](http://localhost:8000/casdoor/login) to initiate the Casdoor OAuth login flow.\n- **Signup Endpoint:**  \n  Visit [http://localhost:8000/casdoor/signup](http://localhost:8000/casdoor/signup) to start the signup process.\n- **Callback Endpoint:**  \n  After authentication, Casdoor redirects to [http://localhost:8000/casdoor/callback](http://localhost:8000/casdoor/callback). This endpoint exchanges the authorization code for tokens and parses the JWT.\n\n## Dify Plugin Integration\nThis repository is structured as a Dify extension plugin:\n- **Manifest File (`manifest.yaml`):**  \n  Contains metadata and required permissions for plugin registration with Dify.\n- **Endpoint YAML Files (in `endpoints/`):**  \n  Define the API paths and HTTP methods for login, signup, and callback endpoints.\n\nFor more details on developing and integrating plugins with Dify, please refer to the [Dify Plugin Documentation](https://docs.dify.ai/plugins/quick-start/develop-plugins/extension-plugin).\n\n## Contributing\nContributions are welcome! Fork the repository and submit pull requests for any improvements. For significant changes, please open an issue to discuss your ideas first.\n\n## License\nThis project is licensed under the [MIT License](LICENSE).\n\n## Contact\nFor questions or support, please contact [Mohammad Fotouhi](mailto:mohammad.fotouhi80@gmail.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohmdfo%2Fcasdoor-dify-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohmdfo%2Fcasdoor-dify-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohmdfo%2Fcasdoor-dify-plugin/lists"}