https://github.com/kit/omniauth-kit-oauth2
Oauth2 strategy for Kit
https://github.com/kit/omniauth-kit-oauth2
kit oauth2 omniauth ruby
Last synced: 4 months ago
JSON representation
Oauth2 strategy for Kit
- Host: GitHub
- URL: https://github.com/kit/omniauth-kit-oauth2
- Owner: Kit
- License: mit
- Created: 2025-01-17T20:40:06.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-09-01T20:29:04.000Z (10 months ago)
- Last Synced: 2025-10-08T01:18:31.875Z (9 months ago)
- Topics: kit, oauth2, omniauth, ruby
- Language: Ruby
- Homepage: https://developers.kit.com
- Size: 96.7 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OmniAuth Kit OAuth2 Strategy
Strategy to authenticate with Kit via OAuth2 in OmniAuth.
Get your API key at: https://app.kit.com/account_settings/developer_settings Note the Client ID and the Client Secret.
For more details, read the Developer docs: https://developers.kit.com/v4
## Installation
Add to your `Gemfile`:
```ruby
gem 'omniauth-kit-oauth2'
```
Then `bundle install`.
## Usage
Here's an example for adding the middleware to a Rails app in `config/initializers/omniauth.rb`:
```ruby
Rails.application.config.middleware.use OmniAuth::Builder do
provider :kit_oauth2, client_id: ENV.fetch("KIT_CLIENT_ID"),
client_secret: ENV.fetch("KIT_CLIENT_SECRET")
end
```
You can now access the OmniAuth Kit OAuth2 URL: `/auth/kit_oauth2`
## Auth Hash
Here's an example of an authentication hash available in the callback by accessing `request.env['omniauth.auth']`:
```ruby
{
"provider" => "kit_oauth2",
"uid" => 1,
"info" => {
"name" => "Creator",
"email" => "creator@example.com"
},
"credentials" => {
"token" => "abc123",
"refresh_token" => "def456",
"expires_at" => 123,
"expires" => true
},
"extra" => {
"raw_info" => {
"user" => {
"email" => "test@example.com"
},
"account" => {
"name" => "Kit Greetings",
"plan_type" => "creator",
"primary_email_address" => "test@example.com",
"created_at" => "2023-02-17T11:43:55Z",
"id" => 26
}
}
}
}
```
## Publishing
New versions can be published using [the "Publish" GitHub
Action](https://github.com/Kit/omniauth-kit-oauth2/actions/workflows/publish.yml).
First you'll need to [update the
version.rb](https://github.com/Kit/omniauth-kit-oauth2/blob/main/lib/omniauth/kit_oauth2/version.rb),
then manually trigger in the UI via the "Run workflow" button.

This will:
- Build the package
- Push up a Git tag
- Push the package to RubyGems