{"id":20844521,"url":"https://github.com/pushpabrol/saml2-assertion-verification-service","last_synced_at":"2025-10-26T00:12:57.874Z","repository":{"id":223498097,"uuid":"760480556","full_name":"pushpabrol/saml2-assertion-verification-service","owner":"pushpabrol","description":"helper to validate saml assertion and extract attributes","archived":false,"fork":false,"pushed_at":"2024-02-21T23:12:48.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T11:15:55.901Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://saml2-assertion-verification-service.vercel.app","language":"JavaScript","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/pushpabrol.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,"zenodo":null}},"created_at":"2024-02-20T13:57:22.000Z","updated_at":"2024-02-20T14:26:30.000Z","dependencies_parsed_at":"2024-02-20T15:48:45.826Z","dependency_job_id":"17253421-0d04-476a-85c2-c21f6b6ff640","html_url":"https://github.com/pushpabrol/saml2-assertion-verification-service","commit_stats":null,"previous_names":["pushpabrol/saml2-assertion-verification-service"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pushpabrol/saml2-assertion-verification-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pushpabrol%2Fsaml2-assertion-verification-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pushpabrol%2Fsaml2-assertion-verification-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pushpabrol%2Fsaml2-assertion-verification-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pushpabrol%2Fsaml2-assertion-verification-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pushpabrol","download_url":"https://codeload.github.com/pushpabrol/saml2-assertion-verification-service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pushpabrol%2Fsaml2-assertion-verification-service/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268372029,"owners_count":24239795,"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-08-02T02:00:12.353Z","response_time":74,"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":"2024-11-18T02:09:52.599Z","updated_at":"2025-10-26T00:12:52.851Z","avatar_url":"https://github.com/pushpabrol.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SAML Assertion Validation Service\n\nThis Node.js service validates SAML assertions, verifies their signatures against an Identity Provider's (IdP) certificate, and extracts user attributes from valid assertions. It's designed to integrate with systems requiring SAML assertion validation, such as OAuth2 or custom authentication flows.\n\n## Features\n\n- Validates SAML assertion signatures using the IdP's public certificate.\n- Extracts user attributes from valid SAML assertions.\n- Configurable via environment variables for flexibility and security.\n- Includes error handling for signature verification and XML parsing.\n\n## Getting Started\n\nThese instructions will help you set up and run the service on your local machine for development and testing purposes.\n\n### Prerequisites\n\n- Node.js (version 12.x or higher recommended)\n- npm (usually comes with Node.js)\n\n### Installation\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/pushpabrol/saml2-assertion-verification-service.git\n   cd saml2-assertion-verification-service\n   ```\n\n2. Install NPM packages:\n   ```bash\n   npm install\n   ```\n\n3. Set up environment variables by creating a `.env` file in the root directory of the project. Add the following content, adjusting the values to match your IdP's certificate and other configurations:\n   ```env\n   IDP_CERT=-----BEGIN CERTIFICATE-----\\nMIID...YOUR_CERTIFICATE_HERE...\\n-----END CERTIFICATE-----\n   ```\n\n### Running the Service\n\nTo start the service, run:\n\n```bash\nnpm start\n```\n\nThis will start the service on a default port (e.g., 3000). You can access the service at `http://localhost:3000`.\n\n## Usage\n\nTo validate a SAML assertion, send a POST request to `/validate-saml` with the assertion as base64 encoded assertion in the json body. Ensure the request's `Content-Type` is set to `application/json`.\n\nExample using `curl`:\n\n```bash\ncurl -X POST http://localhost:3000/validate-saml-assertion \\\n     --header 'Content-Type: application/json' \\\n--data '{\n    \"assertion\" : \"PHNhbWw6Q...YW1sOkFzc2VydGlvbj4=\"\n```\n\nThe service will respond with JSON containing the extracted user attributes if the assertion is valid, or an error message if not.\n\n## Configuration\n\nThe service can be configured via environment variables defined in the `.env` file. Currently supported variables include:\n\n- `IDP_CERT`: The IdP's public certificate for signature verification.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpushpabrol%2Fsaml2-assertion-verification-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpushpabrol%2Fsaml2-assertion-verification-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpushpabrol%2Fsaml2-assertion-verification-service/lists"}