Skip to content
This repository was archived by the owner on Aug 10, 2021. It is now read-only.

Commit d61da60

Browse files
author
Vasile Zaremba
committed
Update Readme
1 parent 4e55b20 commit d61da60

File tree

1 file changed

+54
-12
lines changed

1 file changed

+54
-12
lines changed

README.md

Lines changed: 54 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
# Omniauth::Yoti
1+
# OmniAuth Yoti
22

3-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/omniauth/yoti`. To experiment with that code, run `bin/console` for an interactive prompt.
3+
This gem contains the Yoti strategy for OmniAuth.
44

5-
TODO: Delete this and the text above, and describe your gem
5+
## Before You Begin
66

7-
## Installation
7+
You should have already installed OmniAuth into your app. If not, read the [OmniAuth README](https://github.com/omniauth/omniauth) to get started.
8+
9+
Now sign in into the [Yoti dashboard](https://www.yoti.com/dashboard/login) and create an application. Take note of your Application ID and Yoti client SDK ID because that is what your web application will use to authenticate against the Yoti API. Make sure to set a callback URL and download the pem key.
10+
11+
An Ruby on Rails example app that implements the Yoti OmniAuth strategy can be found in [Yoti Web Labs](https://github.com/lampkicking/yoti-web-labs/tree/master/voting-app)
12+
13+
## Using This Strategy
814

915
Add this line to your application's Gemfile:
1016

@@ -20,22 +26,58 @@ Or install it yourself as:
2026

2127
$ gem install omniauth-yoti
2228

23-
## Usage
29+
## Configuration
30+
31+
Yoti client initialisation looks like this:
32+
33+
```ruby
34+
require 'omniauth-yoti'
35+
36+
Rails.application.config.middleware.use OmniAuth::Builder do
37+
provider :yoti, config: [
38+
application_id: ENV['YOTI_APPLICATION_ID'],
39+
client_sdk_id: ENV['YOTI_CLIENT_SDK_ID'],
40+
key_file_path: ENV['YOTI_KEY_FILE_PATH']
41+
]
42+
end
43+
```
44+
45+
`YOTI_APPLICATION_ID` - found on the *Integrations* settings page, under the Login button section.
46+
47+
`YOTI_CLIENT_SDK_ID` - found on the *Integrations* settings page
2448

25-
TODO: Write usage instructions here
49+
`YOTI_KEY_FILE_PATH` - the full path to your security key downloaded from the *Keys* settings page (e.g. /Users/developer/access-security.pem)
2650

27-
## Development
51+
If you don't have access to the file system to store the pem file, you can replace `key_file_path` with `key`, that stores a string with the content of the secret key (`key: "-----BEGIN RSA PRIVATE KEY-----\nMIIEp..."`).
2852

29-
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.
53+
The configuration values are documented in the [Yoti gem repository](https://github.com/lampkicking/yoti-sdk-server-ruby#configuration).
3054

31-
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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
55+
## Authentication
3256

33-
## Contributing
57+
A call to `/auth/yoti/callback` will open the Yoti authentication page, and after a sucessful authentication, you will be redirected to the callback URL from your Yoti dasboard. The auth hash will be available in `request.env['omniauth.auth']`:
3458

35-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/omniauth-yoti.
59+
```ruby
60+
{
61+
"provider" => "yoti",
62+
"uid" => "mHvpV4...",
63+
"info" => {
64+
"name" => "mHvpV4Mm+yMb..."
65+
},
66+
"credentials" => {},
67+
"extra" => {
68+
"photo" => "data:image/jpeg;base64,/9j/2wCEAAMCAg...",
69+
"given_names" => "Given Name",
70+
"family_name" => "Family Name",
71+
"mobile_number" => "07474747474",
72+
"date_of_birth" => nil,
73+
"address" => nil,
74+
"gender" => nil,
75+
"nationality" => nil
76+
}
77+
}
3678

79+
```
3780

3881
## License
3982

4083
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41-

0 commit comments

Comments
 (0)