https://github.com/ryanwi/omniauth-signalwire
OmniAuth strategy for authenticating to SignalWire
https://github.com/ryanwi/omniauth-signalwire
Last synced: over 1 year ago
JSON representation
OmniAuth strategy for authenticating to SignalWire
- Host: GitHub
- URL: https://github.com/ryanwi/omniauth-signalwire
- Owner: ryanwi
- Created: 2024-02-29T01:33:15.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-29T22:59:31.000Z (over 2 years ago)
- Last Synced: 2025-01-25T18:11:22.829Z (over 1 year ago)
- Language: Ruby
- Homepage: https://developer.signalwire.com
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
[](https://github.com/ryanwi/omniauth-signalwire/actions/workflows/ruby.yml)
# OmniAuth SignalWire
This is an OmniAuth strategy for authenticating to SignalWire.
## Installation
```ruby
gem 'omniauth-signalwire', '~> 0.1'
```
## Basic Usage
```ruby
use OmniAuth::Builder do
provider :signalwire, ENV['SIGNALWIRE_KEY'], ENV['SIGNALWIRE_SECRET']
end
```
## Basic Usage Rails
In `config/initializers/signalwire.rb`
```ruby
Rails.application.config.middleware.use OmniAuth::Builder do
provider :signalwire, ENV['SIGNALWIRE_KEY'], ENV['SIGNALWIRE_SECRET']
end
```
## Authentication Hash
An example auth hash available in `request.env['omniauth.auth']`:
```
{
:provider => "signalwire",
:uid => "4d1bcf6e-88ed-4cfa-87bb-b986cd65678e",
:info => {
:email => "user@example.com",
:first_name => "Jane",
:last_name => "Doe",
:display_name => "Jane Doe",
...
},
:credentials => {
:token => "a1b2c3d4...", # The OAuth 2.0 access token
:refresh_token => "2QY...",
:expires_at => 1709194759,
:expires => true
},
:extra = {
:raw_info => {
...
}
}
}
```
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/ryanwi/omniauth-signalwire.