Giter VIP home page Giter VIP logo

yoti-ruby-sdk's Introduction

Yoti Ruby SDK

Build Status Coverage Bugs Code Smells Vulnerabilities

Welcome to the Yoti Ruby SDK. This repository contains the tools you need to quickly integrate your Ruby back-end with Yoti so that your users can share their identity details with your application in a secure and trusted way.

Table of Contents

  1. Requirements - Everything you need to get started

  2. Installing the SDK - How to install our SDK

  3. Setup - Setup required before using the Yoti services

  4. Products - Links to more information about the products offered by the Yoti SDK

  5. Support - Please feel free to reach out

Requirements

The Yoti gem requires at least Ruby 2.4.0. If you're using a version of Ruby lower than 2.2.2 you might encounter issues when Bundler tries to install the Active Support gem. This can be avoided by manually requiring activesupport 4.2.

gem activesupport '~> 4.2'

Versions of Bundler > 1.13 will sort this dependency issue automatically. More info in this comment by André Arko.

Installing the SDK

To import the Yoti SDK inside your project, add this line to your application's Gemfile:

gem 'yoti'

And then execute:

bundle install

Or simply run the following command from your terminal:

gem install yoti

SDK Project Import

The gem provides a generator for the initialization file:

rails generate yoti:install

The generated initialisation file can be found in config/initializers/yoti.rb.

Setup

For each service you will need:

  • Your Client SDK ID, generated by Yoti Hub when you create (and then publish) your app.
  • Your .pem file. This is your own unique private key which your browser generates from the Yoti Hub when you create an application.

A minimal Yoti client initialisation looks like this:

Yoti.configure do |config|
  config.client_sdk_id = ENV['YOTI_CLIENT_SDK_ID']
  config.key_file_path = ENV['YOTI_KEY_FILE_PATH']
end

Make sure the following environment variables can be accessed by your app:

  • YOTI_CLIENT_SDK_ID
  • YOTI_KEY_FILE_PATH

The following options are available:

Config Required Default Note
client_sdk_id Yes SDK identifier generated by when you publish your app
key_file_path Yes Path to the pem file generated when you create your app
api_url No https://api.yoti.com Path to Yoti URL used for debugging purposes
api_port No 443 Path to Yoti port used for debugging purposes

Keeping your settings and access keys outside your repository is highly recommended. You can use gems like dotenv to manage environment variables more easily.

Deploying to Heroku / AWS Elastic Beanstalk

Although we recommend using a pem file to store your secret key, and take advantage of the UNIX file permissions, your hosting provider might not allow access to the file system outside the deployment process.

If you're using Heroku or other alternative services, you can store the content of the secret key in an environment variable.

Your configuration should look like this:

Yoti.configure do |config|
  config.client_sdk_id = ENV['YOTI_CLIENT_SDK_ID']
  config.key = ENV['YOTI_KEY']
end

Where YOTI_KEY is an environment variable with the following format: YOTI_KEY="-----BEGIN RSA PRIVATE KEY-----\nMIIEp..."

An easier way of setting this on Heroku would be to use the Heroku Command Line

heroku config:add YOTI_KEY ="$(cat your-access-security.pem)"

Products

The Yoti SDK can be used for the following products, follow the links for more information about each:

  1. Yoti app integration - Connect with already-verified customers.
  2. Yoti Doc Scan - Identity verification embedded in your website or app.

Support

For any questions or support please email [email protected]. Please provide the following to get you up and working as quickly as possible:

  • Computer type
  • OS version
  • Version of Ruby being used
  • Screenshot

Once we have answered your question we may contact you again to discuss Yoti products and services. If you’d prefer us not to do this, please let us know when you e-mail.

yoti-ruby-sdk's People

Contributors

davidgrayston avatar dependabot-preview[bot] avatar dependabot[bot] avatar echarrod avatar emmas-yoti avatar hlfh avatar jguthrie100 avatar kiranbali avatar mrburtyyy avatar nikhilpank avatar sidibos avatar vassyz avatar xchangebit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yoti-ruby-sdk's Issues

Retrieving all Profiles

Hi,

I would like to retrieve all profiles using yoti-ruby-sdk but it seems your SDK does not allow to do that.
And the Yoti Dashboard does not offer CSV export. So I'm stuck with people having KYC'd with Yoti before we implemented the yoti-ruby-sdk solution: we have been able to retrieve new profiles, one-one-one with your SDK ; but being able to retrieve all profiles would definitely solve this issue, it is a nightmare with the Yoti Dashboard, at this moment. Can we have access to all the submitted profiles using yoti-ruby-sdk?

Thank you,
Gaspard

SDK authorization issues in a Rails (v6.1.7.3) application

Hello, I tried to contact [email protected] as the new issue template suggests, however I got a warning email that the email doesn't exist so writing here https://i.imgur.com/MmeCPqQ.png

Overview

We are currently trying to build a proof-of-concept for integrating Yoti into our product, and finding that whatever we try we are running into this error with the ruby-sdk:

Yoti::RequestError (Unsuccessful Yoti API call: 
Unauthorized: {
  "error_message": "Failed to verify signature.", 
  "error_code": "INVALID_SIGNATURE"
}):

Things we have tried

Different approaches for config.key_file_path

• Setting config.key_file_path with env var
• Setting config.key_file_path hardcoded as string
• Setting config.key_file_path hardcoded as Rails.root.join('app', 'assets', 'yoti-poc', 'poc-temporary.pem')

We noticed there is also a section in the README which says it is possible to use config.key on Heroku/AWS Elastic Beanstalk, so we also tried:

• Setting config.key hardcoded as string on single line (with and without \n linebreaks)
• Setting config.key hardcoded as string on multiline (with and without \n linebreaks)

Double checking the basics:

• Double checked the SDK ID and .pem file is of the latest key pair (we also tried generating a new key pair)
• Double checked that the relative path is correct by using an open command from project root like code app/assets/yoti-poc/poc-temporary.pem, which opens the correct file in the text editor
• When trying with env vars, double checked that echo $YOTI_KEY_FILE_PATH and echo $YOTI_CLIENT_SDK_ID prints the expected values

I suspect we are overlooking something simple, but as far as I can tell have followed the docs at https://github.com/getyoti/yoti-ruby-sdk exactly. Do you have any ideas what the issue may be?


In case its useful

  • We are grabbing the key-pair from this location in the Yoti hub, with just age-estimation activated: https://i.imgur.com/wCkZphb.png
  • This is how we’ve been calling the Yoti request in our rails controller: https://pastebin.com/raw/QfJiPTf7. Your docs seem to suggest /api/v1 as the API endpoint base just for ruby, however I've presumed that is a typo as:
    • (i) That returns Yoti::RequestError (Unsuccessful Yoti API call: Not Found: Not found):
    • (ii) All other languages use the base /ai/v1
    • (iii) The Endpoints table above the code snippets [here] for request creation suggest the base should be /ai/v1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.