{"id":34612831,"url":"https://github.com/agent-network-protocol/did-wba-example","last_synced_at":"2025-12-24T14:17:46.735Z","repository":{"id":289022074,"uuid":"969867093","full_name":"agent-network-protocol/did-wba-example","owner":"agent-network-protocol","description":"did:wba example","archived":false,"fork":false,"pushed_at":"2025-07-16T04:21:14.000Z","size":218,"stargazers_count":5,"open_issues_count":1,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-17T07:23:03.854Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/agent-network-protocol.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-04-21T04:15:48.000Z","updated_at":"2025-07-16T04:21:18.000Z","dependencies_parsed_at":"2025-07-16T11:10:39.943Z","dependency_job_id":"dd9d8cb8-e85d-4bd6-96d1-a8a5cf6a9b74","html_url":"https://github.com/agent-network-protocol/did-wba-example","commit_stats":null,"previous_names":["agent-network-protocol/did-wba-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/agent-network-protocol/did-wba-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agent-network-protocol%2Fdid-wba-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agent-network-protocol%2Fdid-wba-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agent-network-protocol%2Fdid-wba-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agent-network-protocol%2Fdid-wba-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agent-network-protocol","download_url":"https://codeload.github.com/agent-network-protocol/did-wba-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agent-network-protocol%2Fdid-wba-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28003727,"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","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2025-12-24T14:17:45.867Z","updated_at":"2025-12-24T14:17:46.726Z","avatar_url":"https://github.com/agent-network-protocol.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DID WBA Client and Server Example\n\n\u003e **中文版本**: [README_cn.md](README_cn.md)\n\nThis is a DID WBA method example implemented using FastAPI and Agent_Connect library, supporting both client and server functionality.\n\nFor detailed technical documentation, please refer to [Technical Documentation](/doc/technical_documentation_en.md)\n\n## Features\n\n### Server Features\n- Supports DID WBA authentication protocol\n- Implements two types of authentication:\n  - DID WBA initial authentication\n  - Bearer Token authentication\n- Provides ad.json endpoint with authentication\n\n### Client Features\n- Automatically generates DID documents and private keys, or loads existing DIDs\n- Initiates DID WBA authentication requests to the server\n- Receives and processes access tokens\n- Uses tokens for subsequent requests\n\n## Installation\n\n### Environment Setup\n\n1. Clone the project\n2. Create environment configuration file\n   ```\n   cp .env.example .env\n   ```\n3. Edit the .env file and set necessary configuration items\n\n### Install Dependencies with Poetry\n\n```bash\n# Create virtual environment and install dependencies with Poetry\npoetry install\n\n# Activate virtual environment\npoetry shell\n\n# Or activate virtual environment this way (if it already exists)\nsource .venv/bin/activate\n```\n\n## Running the Example\n\n### Important Note: Start the Server First, Then the Client\n\nTo see the complete interaction, you must first start a server mode, then start the client mode. This is because the client needs to connect to a running server for authentication and interaction.\n\n#### Step 1: Start the Server\n\n```bash\n# Ensure virtual environment is activated\nsource .venv/bin/activate\n\n# Start server in the first terminal window\npython did_server.py\n```\n\n#### Step 2: Start the Client\n\n```bash\n# Start client in the second terminal window, specifying a different port\npython did_server.py --client --port 8001\n```\n\n#### Other Command Options\n\n```bash\n# Run server on specific port\npython did_server.py --port 8001\n\n# Run client with specific id\npython did_server.py --client --unique-id your_unique_id\n```\n\nThe server will start on the specified port (default 8000), and you can access the API documentation at `http://localhost:8000/docs`.\n\n## API Endpoints\n\n- `GET /agents/example/ad.json`: Get agent description information\n- `GET /ad.json`: Get advertisement JSON data, requires authentication\n- `POST /auth/did-wba`: DID WBA initial authentication\n- `GET /auth/verify`: Verify Bearer Token\n- `GET /wba/test`: Test DID WBA authentication\n- `GET /wba/user/{user_id}/did.json`: Get user DID document\n- `PUT /wba/user/{user_id}/did.json`: Save user DID document\n\n## Workflow\n\n### Server Workflow\n1. Start server and listen for requests\n2. Receive DID WBA authentication requests and verify signatures\n3. Generate and return access tokens\n4. Handle subsequent requests using tokens\n\n### Client Workflow\n1. Generate or load DID documents and private keys\n2. Send requests with DID WBA signature headers to the server\n3. Receive and save tokens\n4. Use tokens for subsequent requests\n\n## Authentication\n\nThe example implements two authentication methods:\n\n1. **Initial DID WBA Authentication**: Signature verification according to DID WBA specification\n2. **Bearer Token Authentication**: Subsequent request authentication through JWT tokens\n\nFor detailed authentication flow, please refer to the code implementation and [DID WBA Specification](https://github.com/agent-network-protocol/AgentNetworkProtocol/blob/main/chinese/03-did%3Awba%E6%96%B9%E6%B3%95%E8%A7%84%E8%8C%83.md) ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagent-network-protocol%2Fdid-wba-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagent-network-protocol%2Fdid-wba-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagent-network-protocol%2Fdid-wba-example/lists"}