rootlyhq / omniauth-zendesk-oauth2

OmniAuth strategy for Zendesk via OAuth2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OmniAuth Zendesk via OAuth2

This strategy authenticates against Zendesk via OAuth2. You'll need an OAuth2 Application ID and Secret. See the Zendesk help page for details.

Usage

Single Subdomain

use OmniAuth::Builder.do
  provider :zendesk, ENV['ZD_CLIENT'], ENV['ZD_SECRET'], client_options: {
    site: 'https://yours.zendesk.com'
  }, scope: 'read'
end

Scope can be either read, write or read write.

Multiple Subdomains

If you have Global OAuth enabled for Zendesk you can specify the subdomain in a URL parameter called subdomain. If you would like to do this do not specify a site in the builder because that will override the subdomain parameter.

use OmniAuth::Builder.do
  provider :zendesk, ENV['ZD_CLIENT'], ENV['ZD_SECRET'], scope: 'read'
end

Then your Omniauth URL should be formulated like this: https://mysite.local/auth/zendesk?subdomain=myzendesk

About

OmniAuth strategy for Zendesk via OAuth2

License:MIT License


Languages

Language:Ruby 100.0%