{"id":16614520,"url":"https://github.com/holman/casual","last_synced_at":"2025-10-29T18:31:50.177Z","repository":{"id":856592,"uuid":"589371","full_name":"holman/casual","owner":"holman","description":"A tiny CAS client for Ruby.","archived":false,"fork":false,"pushed_at":"2010-08-10T07:32:25.000Z","size":542,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T04:24:08.992Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/holman.png","metadata":{"files":{"readme":"README.markdown","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}},"created_at":"2010-04-01T01:21:57.000Z","updated_at":"2019-07-08T21:36:03.000Z","dependencies_parsed_at":"2022-08-16T11:10:45.066Z","dependency_job_id":null,"html_url":"https://github.com/holman/casual","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holman%2Fcasual","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holman%2Fcasual/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holman%2Fcasual/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holman%2Fcasual/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/holman","download_url":"https://codeload.github.com/holman/casual/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238874357,"owners_count":19545172,"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":[],"created_at":"2024-10-12T02:06:39.464Z","updated_at":"2025-10-29T18:31:49.876Z","avatar_url":"https://github.com/holman.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Casual\n### Casual is a tiny [CAS](http://en.wikipedia.org/wiki/Central_Authentication_Service) client\n\nThere's a [few](http://github.com/gunark/rubycas-client) [CAS](http://github.com/p8/casablanca) [clients](http://github.com/jamesarosen/casrack_the_authenticator) in [the Ruby world](http://github.com/search?langOverride=\u0026language=rb\u0026q=cas\u0026repo=\u0026start_value=1\u0026type=Repositories\u0026x=25\u0026y=13). Go check them out; there's a very good chance they'll fit your needs. I'll wait.\n\nCool. What I didn't like from existing solutions was that they assumed you were using Rails, they assumed you would use CAS in a particular fashion, and CAS seemed too straightforward to muddy it up with a ten-thousand line client library.\n\nCasual is a übertiny client that doesn't hook into a Rails `before_filter` or deep into Rack middleware. It'll work in irb, it'll work in a simple controller, it'll work underwater. It's based off of another tiny client from [Texas A\u0026M](http://http.tamu.edu/auth/caslibraries/ruby/), except generalized for use outside the school and to avoid REXML (ew).\n\nCasual will work for casual use, like simple and straightforward authentication requirements or as a way to programmatically play around with and understand CAS itself.\n\n## Codes\n\n### Fake end-to-end CAS authentication\nThis bypasses the intermediary CAS single sign-on point, which is frowned upon in the CAS docs since the client gains access to usernames + passwords. But it's also a-nice-to-have if you're building an internal app that is entirely in your control.\n\n    require 'casual'\n    casual = Casual::Client.new(:server_path =\u003e 'local-cas-server'\n                                :port =\u003e 443, # defaults to 443 (SSL)\n                                :callback_url =\u003e 'http://your.example.com')\n    casual.authenticate('holman','super_secret_password')\n      # =\u003e returns 'holman' if I'm logged in, or nil if not\n\n### Simulate traditional CAS authentication\nThis is closer to the normal CAS authentication process. It requires that you send the user off to your CAS login page to transfer tickets between your app and the CAS server, so you can't just do it all in one request.\n\n    require 'casual'\n    casual = Casual::Client.new(:server_path =\u003e 'local-cas-server'\n                                :port =\u003e 443, # defaults to 443 (SSL)\n                                :callback_url =\u003e 'http://your.example.com')\n    casual.authentication_url\n      # returns URL your user should be redirected to\n      # after CAS login, redirects you to +callback_url+ with ticket as param\n    casual.user_login(ticket)\n      # returns username if valid, nil if invalid\n      \n## Casual.\n\nby [@holman](http://twitter.com/holman).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholman%2Fcasual","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fholman%2Fcasual","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholman%2Fcasual/lists"}