0.0
No release in over 3 years
Low commit activity in last 3 years
Wrapper the DingTalk Oauth2 API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.15
~> 10.0
~> 3.0
~> 0.55

Runtime

 Project Readme

Gem Version Build Status

Omniauth DingTalk Strategies

Strategy to authenticate with DingTalk via OAuth2 in OmniAuth.

Get your API key at: http://open-dev.dingtalk.com/ Note the appId and the appSecret.

For more details, read the DingTalk docs: https://open-doc.dingtalk.com/docs/doc.htm?spm=0.0.0.0.oVQWJc&treeId=168&articleId=104878&docType=1

Resolving-CVE-2015-9284

Go to: https://github.com/omniauth/omniauth/wiki/Resolving-CVE-2015-9284

Installation

Add to your Gemfile:

gem 'omniauth-dingtalk'

Then bundle install.

appId & appSecret

Go to: https://open-doc.dingtalk.com/docs/doc.htm?spm=a219a.7629140.0.0.o96KrM&treeId=168&articleId=104882&docType=1

Usage

Here's an example for adding the middleware to a Rails app in config/initializers/omniauth.rb:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :dingtalk, "Your_OAuth_App_ID", "Your_OAuth_App_Secret"
end

You can now access the OmniAuth DingTalk OAuth2 URL: /auth/dingtalk

For more examples please check out example/config.ru

Auth Hash

Here's an example of an authentication hash available in the callback by accessing request.env['omniauth.auth']:

{
  "provider": "dingtalk",
  "uid": "uid" # this is openid in DingTalk
}