Skip to content

Latest commit

History

1,152 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

ruby-openid Logo by GitHub

💎 ruby-openid2 / OpenID

VersionRuby Users ForumGitHub tag (latest SemVer)License: Ruby OR Apache Software License 2.0Total downloadsCodeCov Test CoverageCoveralls Test CoverageQLTY Test CoverageQLTY MaintainabilityCI HeadsCI Runtime Dependencies @ HEADCI CurrentCI Truffle RubyCI JRubyDeps LockedDeps UnlockedCI Test CoverageCI Style

if ci_badges.map(&:color).detect { it != "green"} ☝️ let me know on Discord or RubyForum, as I may have missed the notification.


if ci_badges.map(&:color).all? { it == "green"} 👇️ send money so I can do more of this. FLOSS maintenance is now my full-time job.

OpenCollective BackersOpenCollective SponsorsSponsor Me on GithubLiberapay Goal ProgressDonate on PayPalBuy me a coffeeDonate at ko-fi.com

👣 How will this project approach the September 2025 hostile takeover of RubyGems? 🚑️

I've summarized my thoughts in this blog post.

🌻 Synopsis Galtzo FLOSS Logo by Aboling0, CC BY-SA 4.0ruby-lang Logo, Yukihiro Matsumoto, Ruby Visual Identity Team, CC BY-SA 2.5

ruby-openid2 is the protocol library behind the Ruby OpenID stack. It provides consumer and server APIs, discovery, association management, stores, and the SReg, Attribute Exchange, PAPE, OAuth, and UI extensions for OpenID 1.x/2.0.

Use it directly when a framework adapter is not appropriate, or use rack-openid2 and open_id_authentication for Rack and Rails integration. This project implements OpenID, not OpenID Connect (OIDC).

💡 Info you can shake a stick at

Tokens to RememberGem nameGem namespace
Works with JRubyJRuby 9.4 CompatJRuby 10.0 CompatJRuby current CompatJRuby HEAD Compat
Works with Truffle RubyTruffle Ruby 22.3 CompatTruffle Ruby 23.0 CompatTruffle Ruby 23.1 Compat
Truffle Ruby 24.2 CompatTruffle Ruby 25.0 CompatTruffle Ruby 33.0 CompatTruffle Ruby current CompatTruffle Ruby HEAD Compat
Works with MRI Ruby 4Ruby current CompatRuby HEAD Compat
Works with MRI Ruby 3Ruby 3.0 CompatRuby 3.1 CompatRuby 3.2 CompatRuby 3.3 CompatRuby 3.4 Compat
Works with MRI Ruby 2Ruby 2.7 Compat
Support & CommunityJoin Me on Daily.dev's RubyFriendsGet help from RubyForumLive Chat on DiscordGet help from me on UpworkGet help from me on Codementor
SourceSource on GitLab.comSource on CodeBerg.orgSource on GitHub.comThe best SHA: dQw4w9WgXcQ!
DocumentationCurrent release on RubyDoc.infoYARD on Galtzo.comMaintainer BlogGitLab WikiGitHub Wiki
ComplianceLicense: Ruby OR Apache Software License 2.0Apache license compatibility: Unknown📄ilo-declaration-imgSecurity PolicyContributor Covenant 2.1SemVer 2.0.0
StyleEnforced Code Style LinterKeep-A-Changelog 1.0.0Gitmoji CommitsCompatibility appraised by: appraisal2
Maintainer 🎖️Follow Me on LinkedInFollow Me on Ruby.SocialFollow Me on BlueskyContact MaintainerMy technical writing
... 💖Find Me on WellFound:Find Me on CrunchBaseMy LinkTreeMore About Me🧊🐙🛖🧪

Compatibility

Compatible with MRI Ruby 2.7.0+, and concordant releases of JRuby, and TruffleRuby. CI workflows and Appraisals are generated for MRI Ruby 2.7.0+. This test floor is configured by ruby.test_minimum in .kettle-jem.yml and may be higher than the gem's runtime compatibility floor when legacy Rubies are not practical for the current toolchain.

kettle-dev Logo by Aboling0, CC BY-SA 4.0

The amazing test matrix is powered by the kettle-dev stack.

How kettle-dev manages complexity in tests
GemSourceRoleTotal downloads
appraisal2GitHubmulti-dependency Appraisal matrix generationTotal downloads for appraisal2
appraisal2-rubocopGitHubRuboCop Appraisal generator integrationTotal downloads for appraisal2-rubocop
kettle-devGitHubdevelopment, release, and CI workflow toolingTotal downloads for kettle-dev
kettle-jemGitHubAppraisals & CI workflow templatesTotal downloads for kettle-jem
kettle-soup-coverGitHubSimpleCov coverage policy and reportingTotal downloads for kettle-soup-cover
kettle-testGitHubstandard test runner and coverage harnessTotal downloads for kettle-test
rubocop-ltsGitHubRuby-version-aware lintingTotal downloads for rubocop-lts
turbo_tests2GitHubparallel test executionTotal downloads for turbo_tests2

Federated DVCS

Find this repo on federated forges (Coming soon!)
Federated DVCS RepositoryStatusIssuesPRsWikiCI
🧪 ruby-openid/ruby-openid2 on GitLabThe Truth💚💚💚🐭 Tiny Matrix
🧊 ruby-openid/ruby-openid2 on CodeBergAn Ethical Mirror (Donate)💚💚⭕️ No Matrix
🐙 ruby-openid/ruby-openid2 on GitHubAnother Mirror💚💚💚💯 Full Matrix

Enterprise Support Tidelift

Available as part of the Tidelift Subscription.

Need enterprise-level guarantees?

The maintainers of this and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use.

Get help from me on Tidelift

  • 💡Subscribe for support guarantees covering all your FLOSS dependencies
  • 💡Tidelift is part of Sonar
  • 💡Tidelift pays maintainers to maintain the software you depend on!
    📊@Pointy Haired Boss: An enterprise support subscription is "never gonna let you down", and supports open source maintainers

Alternatively:

  • Ruby Users Forum
  • Live Chat on Discord
  • Get help from me on Upwork
  • Get help from me on Codementor

✨ Installation

Install the gem and add to the application's Gemfile by executing:

bundle add ruby-openid2

If bundler is not being used to manage dependencies, install the gem by executing:

gem install ruby-openid2

⚙️ Configuration

Create an OpenID::Consumer for each request with a session-like object and a durable store. The session holds the in-progress authentication transaction; the store holds associations and nonces shared across requests.

require"openid"require"openid/consumer"require"openid/store/filesystem"store=OpenID::Store::Filesystem.new("tmp/openid")consumer=OpenID::Consumer.new(session,store)

OpenID::Store::Memory is useful for tests and one long-running process, but it is not thread-safe or durable. Use Filesystem, Memcache, or a custom OpenID::Store implementation for deployments that need state shared across requests or processes. When serving as an OpenID provider, construct OpenID::Server::Server with the same kind of durable store and the public endpoint URL.

🔧 Basic Usage

Create a consumer with a durable store, begin authentication with the provider URL, and redirect the user to the returned authentication URL:

require"openid/consumer"require"openid/store/filesystem"store=OpenID::Store::Filesystem.new("tmp/openid")consumer=OpenID::Consumer.new(session,store)request=consumer.begin("https://provider.example/openid")redirect_torequest.redirect_url("https://example.test/openid/callback")

On the callback request, pass the provider response back to the consumer and handle the resulting OpenID::Consumer::Response according to its status.

🔐 Security

See SECURITY.md.

🤝 Contributing

If you need some ideas of where to help, you could work on adding more code coverage, or if it is already 💯 (see below) check issues or PRs, or use the gem and think about how it could be better.

We Keep A Changelog so if you make changes, remember to update it.

See CONTRIBUTING.md for more detailed instructions.

🚀 Release Instructions

See CONTRIBUTING.md.

Code Coverage

Coverage service badges

Coverage Graph

Coveralls Test Coverage

QLTY Test Coverage

🪇 Code of Conduct

Everyone interacting with this project's codebases, issue trackers, chat rooms and mailing lists agrees to follow the Contributor Covenant 2.1.

🌈 Contributors

Contributors

Made with contributors-img.

Also see GitLab Contributors: https://gitlab.com/ruby-openid/ruby-openid2/-/graphs/main

⭐️ Star HistoryStar History Chart

📌 Versioning

This library follows Semantic Versioning 2.0.0 for its public API where practical. For most applications, prefer the Pessimistic Version Constraint with two digits of precision.

For example:

spec.add_dependency("ruby-openid2","~> 3.0")
📌 Is "Platform Support" part of the public API? More details inside.

Dropping support for a platform can be a breaking change for affected users. If a release changes supported platforms, it should be called out clearly in the changelog and versioned with that impact in mind.

To get a better understanding of how SemVer is intended to work over a project's lifetime, read this article from the creator of SemVer:

See CHANGELOG.md for a list of releases.

📄 License

The gem is available under the following licenses: Ruby, [Apache Software License 2.0](https://github.com/ruby-openid/ruby-openid2/blob/main/Apache Software License 2.0.md). See LICENSE.md for details.

If none of the available licenses suit your use case, please contact us to discuss a custom commercial license.

© Copyright

See LICENSE.md for the official copyright notice.

Copyright holders
  • Copyright (c) 2005-2007 tailor
  • Copyright (c) 2006 Josh Hoyt
  • Copyright (c) 2007-2008 http://j3h.us/
  • Copyright (c) 2007-2008 Kevin Turner
  • Copyright (c) 2007-2008 tailor
  • Copyright (c) 2007-2009 tailor
  • Copyright (c) 2008-2010 Carl Howells
  • Copyright (c) 2008 tailor
  • Copyright (c) 2008 tailor
  • Copyright (c) 2010 dbloete
  • Copyright (c) 2010 Kouhei Sutou
  • Copyright (c) 2010 Lilli
  • Copyright (c) 2010 Mike Mell
  • Copyright (c) 2011 mcary
  • Copyright (c) 2011-2012 nov matake
  • Copyright (c) 2011 Steven Davidovitz
  • Copyright (c) 2011 Tom Quackenbush
  • Copyright (c) 2012 Cal Heldenbrand
  • Copyright (c) 2012-2015 Dennis Reimann
  • Copyright (c) 2012 grosser
  • Copyright (c) 2013 Akira Matsuda
  • Copyright (c) 2013 Kendall Buchanan
  • Copyright (c) 2013 Kenichi Kamiya
  • Copyright (c) 2013 Marcel M. Cary
  • Copyright (c) 2013 Mike Dillon
  • Copyright (c) 2013, 2019 Tobias Haagen Michaelsen
  • Copyright (c) 2013 Zaid Zawaideh
  • Copyright (c) 2014 grosser
  • Copyright (c) 2014 Ken Dreyer
  • Copyright (c) 2014 ppretorius
  • Copyright (c) 2014 tsukasaoishi
  • Copyright (c) 2014 vivek
  • Copyright (c) 2017 Kazuhiro Serizawa
  • Copyright (c) 2018 Abraham Sangha
  • Copyright (c) 2018 IanAtLooker
  • Copyright (c) 2018-2019 Tobias Haagen Michaelsen
  • Copyright (c) 2019 Olle Jonsson
  • Copyright (c) 2019 Utkarsh Gupta
  • Copyright (c) 2019 Vadim Shaulski
  • Copyright (c) 2020 Randy Ebersole
  • Copyright (c) 2024-2026 Peter H. Boling

🤑 A request for help

Maintainers have teeth and need to pay their dentists. After getting laid off in an RIF in March, and encountering difficulty finding a new one, I began spending most of my time building open source tools. I'm hoping to be able to pay for my kids' health insurance this month, so if you value the work I am doing, I need your support. Please consider sponsoring me or the project.

To join the community or get help, use the RubyForum or Discord.

Ruby Users ForumLive Chat on Discord

To say "thanks!" ☝️ Join the community or 👇️ send money.

Sponsor ruby-openid/ruby-openid2 on Open Source Collective 💌 Sponsor me on GitHub Sponsors 💌 Sponsor me on Liberapay 💌 Donate on PayPal

Please give the project a star ⭐ ♥.

Many parts of this project are actively managed by a kettle-jem smart template utilizing StructuredMerge.org merge contracts.

Thanks for RTFM. ☺️

FieldValue
Packageruby-openid2
Description💎 A library for consuming and serving OpenID identities.
Homepagehttps://github.com/ruby-openid/ruby-openid2
Sourcehttps://github.com/ruby-openid/ruby-openid2
LicenseRuby OR Apache Software License 2.0
Fundinghttps://github.com/sponsors/pboling, https://ko-fi.com/pboling, https://liberapay.com/pboling/donate, https://opencollective.com/ruby-openid, https://thanks.dev/gh/pboling, https://tidelift.com/funding/github/rubygems/ruby-openid2, https://www.buymeacoffee.com/pboling

About

OpenID library for Ruby

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

12 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages