Skip to content

jpalumickas/auth0-verifier

Repository files navigation

Auth0 Verifier

Verify Auth0 JWT token using RS256 with JWKS method.

Gem Version Coverage Status

Installation

Add this line to your application's Gemfile:

gem 'auth0-verifier'

Usage

In Rails using initializer

Create file config/initializers/auth0.rb and add:

Auth0::Verifier.configure do |config|
  config.domain = 'test.auth0.com' # Defaults to ENV variable AUTH0_DOMAIN
  config.audience = 'https://example.com' # Defaults to ENV variable AUTH0_AUDIENCE

  # Optional:
  #
  # config.type = :RS256 # Default RS256 using JWKS
  # config.jwks_url = 'https://test.auth0.com/.well-known/jwks.json' # Defaults to domain
end

Verify token:

Auth0::Verifier.verify('my token')

Supported Ruby Versions

This library aims to support and is tested against the following Ruby implementations:

  • Ruby 2.6
  • Ruby 2.7
  • Ruby 3.0
  • Ruby 3.1

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/jpalumickas/auth0-verifier. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

Code of Conduct

Everyone interacting in the Auth0 Verifier project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

Copyright

Copyright (c) 2022 Justas Palumickas. See LICENSE for details.