omniauth-ainews-auth 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/README.md +95 -1
- data/lib/omniauth/ainews_auth/version.rb +1 -1
- data/lib/omniauth/strategies/ainews_auth.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b65714daec3bcf07f18f974fae58cf601a38af92744521ee3271707621fd989e
|
|
4
|
+
data.tar.gz: 3e6b2fe0fb677619026055f0283ef7461b82c6ebe6959313907ceaaa405027ab
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 957d4c22da85e3a935b206a8c26c0c37c94b534a9644ddc02c748cebe3530b3453d5b3964b1a63ab72f2da3eb1eee9f6625719211226e49a5dcd5fbf867b9dc5
|
|
7
|
+
data.tar.gz: 01a271974beed63f82ec5e9c1815879e813859f0bd7708bb5b735a7c171c5c83b590dc230f29df5ba86faa3363ee3ffcdfd058b9220d06a5b073be6386869404
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -1,2 +1,96 @@
|
|
|
1
|
-
#
|
|
1
|
+
# OmniAuth::AinewsAuth
|
|
2
2
|
|
|
3
|
+
AinewsAuth omniauth-oauth2 provider used to authenticate users with
|
|
4
|
+
_https://b2b.ainews.kz/login/_ or _https://dev-auth.dev.b2b.aitudala.net/login_
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
Add this line to your application's Gemfile:
|
|
9
|
+
|
|
10
|
+
```ruby
|
|
11
|
+
gem 'omniauth-ainews-auth'
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
And then execute:
|
|
15
|
+
|
|
16
|
+
$ bundle install
|
|
17
|
+
|
|
18
|
+
Or install it yourself as:
|
|
19
|
+
|
|
20
|
+
$ gem install omniauth-ainews-auth
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
1. Add it to your Gemfile:
|
|
25
|
+
```ruby
|
|
26
|
+
gem 'omniauth-ainews-auth
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
2. Bundle it:
|
|
30
|
+
|
|
31
|
+
```shell
|
|
32
|
+
$ bundle install
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
3. Add provider to your omniauth initializer
|
|
36
|
+
|
|
37
|
+
```ruby
|
|
38
|
+
|
|
39
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
|
40
|
+
provider :ainews_auth,
|
|
41
|
+
ENV['AINEWS_CLIENT_ID'],
|
|
42
|
+
ENV['AINEWS_CLIENT_SECRET'],
|
|
43
|
+
{
|
|
44
|
+
provider_ignores_state: Rails.env == 'production' ? false : true,
|
|
45
|
+
token_params: {
|
|
46
|
+
redirect_uri: ENV['AINEWS_REDIRECT_URI'],
|
|
47
|
+
client_id: ENV['AINEWS_CLIENT_ID'],
|
|
48
|
+
client_secret: ENV['AINEWS_CLIENT_SECRET']
|
|
49
|
+
},
|
|
50
|
+
client_options: {
|
|
51
|
+
redirect_uri: ENV['AINEWS_REDIRECT_URI']
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
OmniAuth.config.logger = Rails.logger
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
using the keys you receive and URI you provided when registered the app
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
4. Use it in your sessions controller on your own, assuming the following envs to store the data you need
|
|
63
|
+
|
|
64
|
+
```ruby
|
|
65
|
+
|
|
66
|
+
request.env['omniauth.auth'] # auth_hash
|
|
67
|
+
|
|
68
|
+
request.env['omniauth.params'] # auth_params
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Also you can switch between production and dev auth stand using key
|
|
73
|
+
|
|
74
|
+
```ruby
|
|
75
|
+
ENV['AINEWS_AUTH_DEV'] = true
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
5. Enjoy!
|
|
79
|
+
|
|
80
|
+
## Development
|
|
81
|
+
|
|
82
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
83
|
+
|
|
84
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
85
|
+
|
|
86
|
+
## Contributing
|
|
87
|
+
|
|
88
|
+
Bug reports and pull requests are welcome on GitLab at https://gitlab.btsd.kz/news-saas/b2b-auth-gem. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://gitlab.btsd.kz/news-saas/b2b-auth-gem/blob/main/CODE_OF_CONDUCT.md).
|
|
89
|
+
|
|
90
|
+
## License
|
|
91
|
+
|
|
92
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
|
93
|
+
|
|
94
|
+
## Code of Conduct
|
|
95
|
+
|
|
96
|
+
Everyone interacting in the Omniauth::Aitu::Passport project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://gitlab.btsd.kz/news-saas/b2b-auth-gem/blob/main/CODE_OF_CONDUCT.md).
|
|
@@ -10,7 +10,7 @@ module OmniAuth
|
|
|
10
10
|
option :name, :ainews_auth
|
|
11
11
|
|
|
12
12
|
option :client_options, {
|
|
13
|
-
site: 'https://dev-auth.dev.b2b.aitudala.net',
|
|
13
|
+
site: ENV['B2B_AUTH_DEV'] ? 'https://dev-auth.dev.b2b.aitudala.net' : 'https://b2b.ainews.kz',
|
|
14
14
|
token_url: '/login/v1/access-token',
|
|
15
15
|
authorize_url: '/login/authorize',
|
|
16
16
|
token_method: :post,
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: omniauth-ainews-auth
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yaroslav Shevchenko
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-05-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: oauth2
|
|
@@ -96,7 +96,7 @@ dependencies:
|
|
|
96
96
|
version: '0.49'
|
|
97
97
|
description: Gem to use with Ainews Auth Omniauth provider
|
|
98
98
|
email:
|
|
99
|
-
-
|
|
99
|
+
- iaroslav.shevchenko@aitudala.kz
|
|
100
100
|
executables: []
|
|
101
101
|
extensions: []
|
|
102
102
|
extra_rdoc_files: []
|
|
@@ -144,5 +144,5 @@ requirements: []
|
|
|
144
144
|
rubygems_version: 3.2.3
|
|
145
145
|
signing_key:
|
|
146
146
|
specification_version: 4
|
|
147
|
-
summary: Omniauth
|
|
147
|
+
summary: Omniauth Ainews Auth Provider
|
|
148
148
|
test_files: []
|