To allow devices to start verifications, you'll need to provide a JWT to the devices.

in #jwt5 years ago

To allow devices to start verifications, you'll need to provide a JWT to the devices.


An optional value to change the number of verification code digits sent. The default value is 4, and acceptable values are 4-10.
An epoch timestamp that sets the expiration date of this token. The default and maximum value is 1 hour. For security reasons, expired JWTs are rejected and the issue date is taken into account.

20181120_153756_883.jpg

tkgcci

require 'jwt'

post "/verify/token" do
  param :phone_number, String, required: true

  payload = {
    app_id: ENV["APP_ID"],
    phone_number: params[:phone_number],
    iat: Time.now.to_i
  }

  jwt_token = JWT.encode(payload, ENV["AUTHY_API_KEY"], "HS256")

  respond_with status: 200, body: {jwt_token: jwt_token}
end

Coin Marketplace

STEEM 0.17
TRX 0.13
JST 0.027
BTC 60522.54
ETH 2602.42
USDT 1.00
SBD 2.64