{"id":19673386,"url":"https://github.com/weihanchen/saml2-express-ts-sample","last_synced_at":"2025-07-08T04:04:23.715Z","repository":{"id":41575639,"uuid":"510279551","full_name":"weihanchen/saml2-express-ts-sample","owner":"weihanchen","description":"An example for saml2 integration with Auth0、OKTA、saml-idp, 🔥 support upload metadata","archived":false,"fork":false,"pushed_at":"2023-02-07T12:31:49.000Z","size":715,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-27T05:17:17.837Z","etag":null,"topics":["adfs","okta","saml2","sso"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/weihanchen.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}},"created_at":"2022-07-04T08:44:58.000Z","updated_at":"2023-09-25T13:04:06.000Z","dependencies_parsed_at":"2023-01-30T00:31:05.902Z","dependency_job_id":null,"html_url":"https://github.com/weihanchen/saml2-express-ts-sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/weihanchen/saml2-express-ts-sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weihanchen%2Fsaml2-express-ts-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weihanchen%2Fsaml2-express-ts-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weihanchen%2Fsaml2-express-ts-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weihanchen%2Fsaml2-express-ts-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weihanchen","download_url":"https://codeload.github.com/weihanchen/saml2-express-ts-sample/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weihanchen%2Fsaml2-express-ts-sample/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264192223,"owners_count":23570735,"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":["adfs","okta","saml2","sso"],"created_at":"2024-11-11T17:15:06.326Z","updated_at":"2025-07-08T04:04:23.678Z","avatar_url":"https://github.com/weihanchen.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"saml2-express-ts-sample\n===\n\nThis Project is an example for saml2 integration with [saml-idp](https://github.com/mcguinness/saml-idp)、auth0、OKTA.\n\n🔥 Support Upload Metadata...\n\n## Quick Start\n\n### self-signed certificate\nIf you need stronger security, please use credentials for mutual security verification\n\ngenerate service provider's cert\n\n```sh\ncd initial\nopenssl req -newkey rsa:4096 -x509 -nodes -sha256 -keyout sp.pem -out sp.crt\n```\n\n### Start with  Service Provider\n```sh\nnpm run start:dev\n```\n\n### Configuration with IDP\n- [(✔️ default) saml-idp](https://github.com/mcguinness/saml-idp)\n```bash\ngit clone https://github.com/mcguinness/saml-idp\n\n|- saml2-express-ts-sample\n    |- ...\n|- saml-idp\n    |- ...\n\ncd saml-idp\n\nnpm start -- --host=localhost \\\n             --port=5857 \\\n             --acsUrl=http://localhost:5858/auth/saml2/acs \\\n             --sloUrl=http://localhost:5858/auth/saml2/sls \\\n             --aud=http://localhost:5858/auth/saml2/acs \\\n             --enc=true \\\n             --encCert=\"../saml2-express-ts-sample/initial/sp.cer\" \\\n             --encKey=\"../saml2-express-ts-sample/initial/sp.key\"\n```\n- [auth0](./auth0.md)\n- [okta](https://developer.okta.com/docs/concepts/saml/#federated-identity)\n\n\n\n\n## Redirect to IDP\nWhen the user directly accesses the service provider, sp should redirect to the idp login follow sso.\n\n- GET `auth/saml2`: Redirect to IDP\n\n## Identity Provider Configuration\n- GET `/auth/saml2/metadata`: Metadata endpoint \n- POST `/auth/saml2/acs`: Assertion Consumer Service endpoint \n- GET `/auth/saml2/sls`: Single Logout Service endpoint \n\n## How to update idp configuration with metadata?\n\n- PUT `/auth/saml2/idp-metadata`\n    - body\n        - url(string): `idp's metdata url`\n\n```sh\ncurl -XPUT localhost:5858/auth/saml2/idp-metadata -d '{\"url\": \"http://localhost:5857/metadata\"}' -H 'Content-Type: application/json'\n```\n\n\n## Service Provider Configuration\n\n[🔍 Here](./.env)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweihanchen%2Fsaml2-express-ts-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweihanchen%2Fsaml2-express-ts-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweihanchen%2Fsaml2-express-ts-sample/lists"}