Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/liukun-lk/omniauth-dingtalk
OmniAuth strategy for DingTalk.
https://github.com/liukun-lk/omniauth-dingtalk
dingtalk oauth2 omniauth-dingtalk omniauth-strategy rails ruby
Last synced: 3 months ago
JSON representation
OmniAuth strategy for DingTalk.
- Host: GitHub
- URL: https://github.com/liukun-lk/omniauth-dingtalk
- Owner: liukun-lk
- License: mit
- Created: 2017-12-12T12:29:49.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-15T21:43:39.000Z (almost 2 years ago)
- Last Synced: 2024-10-27T05:43:25.434Z (3 months ago)
- Topics: dingtalk, oauth2, omniauth-dingtalk, omniauth-strategy, rails, ruby
- Language: Ruby
- Homepage:
- Size: 50.8 KB
- Stars: 2
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[![Gem Version](https://badge.fury.io/rb/omniauth-dingtalk.svg)](https://badge.fury.io/rb/omniauth-dingtalk)
[![Build Status](https://travis-ci.org/liukun-lk/omniauth-dingtalk.svg?branch=master)](https://travis-ci.org/liukun-lk/omniauth-dingtalk)# 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`:
```ruby
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`:
```ruby
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']`:
```ruby
{
"provider": "dingtalk",
"uid": "uid" # this is openid in DingTalk
}
```