{"id":16676421,"url":"https://github.com/thekid/cas","last_synced_at":"2025-03-13T05:23:35.108Z","repository":{"id":37094515,"uuid":"203257207","full_name":"thekid/cas","owner":"thekid","description":"CAS Server in PHP","archived":false,"fork":false,"pushed_at":"2025-02-16T10:51:09.000Z","size":549,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-16T11:26:09.730Z","etag":null,"topics":["authentication","cas","cas-server","mfa","php7","php8","totp","xp-framework"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/thekid.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","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}},"created_at":"2019-08-19T22:10:50.000Z","updated_at":"2025-02-16T10:49:52.000Z","dependencies_parsed_at":"2024-11-19T00:46:31.349Z","dependency_job_id":"3835b41f-59c7-421f-b18a-0436a73d8066","html_url":"https://github.com/thekid/cas","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thekid%2Fcas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thekid%2Fcas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thekid%2Fcas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thekid%2Fcas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thekid","download_url":"https://codeload.github.com/thekid/cas/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243347127,"owners_count":20276133,"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":["authentication","cas","cas-server","mfa","php7","php8","totp","xp-framework"],"created_at":"2024-10-12T13:10:25.573Z","updated_at":"2025-03-13T05:23:35.100Z","avatar_url":"https://github.com/thekid.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"CAS Server\n==========\n\n[![Build status on GitHub](https://github.com/thekid/cas/workflows/Tests/badge.svg)](https://github.com/thekid/cas/actions)\n[![Uses XP Framework](https://raw.githubusercontent.com/xp-framework/web/master/static/xp-framework-badge.png)](https://github.com/xp-framework/core)\n[![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md)\n[![Requires PHP 7.4+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_4plus.svg)](http://php.net/)\n[![Supports PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)\n![Less than 1000 lines](https://raw.githubusercontent.com/xp-framework/web/master/static/less-than-1000LOC.png)\n\nMinimalistic [CAS](https://apereo.github.io/cas/) Server in PHP supporting MySQL / MariaDB or MongoDB persistence.\n\n![image](https://user-images.githubusercontent.com/696742/96371316-6a6d9b00-1161-11eb-8662-0d96e23610f7.png)\n\nSetup\n-----\nFor use with MySQL / MariaDB, create a database with the following tables (*the following uses MySQL syntax, adopt if necessary!*):\n\n```bash\n# Create database and tables\n$ cat src/main/sql/mysql-schema.ddl | mysql -u root\n\n# Create user\n$ mysql -u root -e \"grant all on IDENTITIES.* to 'cas'@'%' identified by '...'\"\n```\n\nMongoDB collections are created automatically when the first document is inserted - so the only thing necessary is to create the user for the respective database, as shown in the following Mongo CLI commands:\n\n```javascript\nmongo\u003e use admin;\nmongo\u003e db.createUser({\n  user: \"cas\",\n  pwd: \"...\",\n  roles: [ { role: \"readWrite\", db: \"cas\" } ]\n})\n```\n\nRun composer:\n\n```sh\n$ composer install\n# ...\n```\n\nExport environment:\n\n```sh\n$ export CAS_DB_PASS=... # The one you used when creating the database user above\n$ export REDIS_PASS=...  # Sessions use filesystem during development, redis only in prod\n$ export CRYPTO_KEY=...  # Must have 32 characters, generate with `openssl rand -base64 24`\n```\n\nYou can also put these variables into a file named **credentials**, if you wish:\n\n```sh\n$ cat \u003e credentials\nCAS_DB_PASS=...\nCRYPTO_KEY=...\nREDIS_PASS=...\n```\n\nRunning\n-------\nStart the server:\n\n```sh\n# For MySQL / MariaDB\n$ xp serve -p dev -c src/main/etc/sql\n\n# For MongoDB\n$ xp serve -p dev -c src/main/etc/mongo\n```\n\n*Now open http://localhost:8080/login in your browser.*\n\nTo change the address and port the server runs on, add `-a 0.0.0.0:8443` to the above command line.\n\nUser management\n---------------\nAll of the following use the *sql* configuration. For use with MongoDB, use `src/main/etc/mongo` instead!\n\n```sh\n# Create a new user; generating a random password if necessary\n$ xp cmd -c src/main/etc/sql NewUser \u003cuser\u003e [--password=\u003cpassword\u003e]\n\n# Change a user's password\n$ xp cmd -c src/main/etc/sql ChangePassword \u003cuser\u003e [--password=\u003cpassword\u003e]\n\n# Remove an existing user\n$ xp cmd -c src/main/etc/sql RemoveUser \u003cuser\u003e\n\n# List all users\n$ xp cmd -c src/main/etc/sql ListUsers\n\n# Filter users on their username. Use * to match any character\n$ xp cmd -c src/main/etc/sql ListUsers 't*'\n```\n\nSetting up MFA\n--------------\n\n```sh\n# Create a new token\n$ xp cmd -c src/main/etc/sql NewToken \u003cuser\u003e [--name=\u003cname\u003e]\n\n# List existing tokens\n$ xp cmd -c src/main/etc/sql ListTokens \u003cuser\u003e\n\n# Remove an existing token\n$ xp cmd -c src/main/etc/sql RemoveToken \u003cuser\u003e \u003cname\u003e\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthekid%2Fcas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthekid%2Fcas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthekid%2Fcas/lists"}