In order to build Salt Edge Authenticator Identity Service Example, it is necessary to install the following tools:
-
Ruby 2.4 or greater
-
sqlite3
dpkg -s sqlite3
or
apt-get install sqlite3 libsqlite3-dev
-
Bundler
gem install bundler
-
Web server (e.g. nginx) or tunnel (e.g. ngrok)
Note: Authenticator Mobile clients supports only SSL connections.
Fork this repository
-
Change directory:
cd saltedge-sca-service-sinatra
-
Run Bundler to pull the required dependencies:
bundle install
-
Init database configuration
- Create
config/database.yml
(cp config/database.example.yml config/database.yml
) - Change configuiration if you don't need default one.
- Run Rake task to initiate database
bundle exec rake db:migrate
- Create
-
Authenticator Identity Service can send push notifications to mobile clients.
- Create
config/application.yml
(cp config/application.example.yml config/application.yml
) - For activating fill required fields (optional)
- Create
-
Create database (for the first time)
bundle exec rake db:migrate
or drop before
bundle exec rake db:drop
-
Run application
rackup config.ru
-
Change directory:
cd saltedge-sca-service-sinatra
-
Init database configuration
- Create
config/database.yml
(cp config/database.example.yml config/database.yml
) - Change configuiration if you don't need default one.
- Run Rake task to initiate database
bundle exec rake db:migrate
- Create
-
Authenticator Identity Service can send push notifications to mobile clients.
- Create
config/application.yml
(cp config/application.example.yml config/application.yml
) - For activating fill required fields (optional)
- Create
-
Build Docker image:
docker build -t authenticator/sinatra .
-
Run Docker container and application:
docker run --rm -p 4567:4567 -v "$(pwd)":/sinatra-example/ --name service authenticator/sinatra
-
Create database and run migrations (for the first time) in new terminal window
docker exec -ti service bash
and run mugrations in docker container
bundle exec rake db:migrate
or drop before
bundle exec rake db:drop
-
Create new user (if needed)
curl -w "\n" -d "name=Test&password=test" -X POST http://your_host:4567/admin/users
-
Connect mobile client
-
Create test authorization
curl -w "\n" -d "user_id=1&title=Create%20a%20payment&description=550$%20for%20Air%20America&authorization_code=123456789" -X POST http://your_host:4567/admin/authorizations
Described above functions are available on Admin page http://your_host:4567/admin
Copyright © 2019 Salt Edge. https://www.saltedge.com