Skip to content

Latest commit

 

History

History
93 lines (76 loc) · 2.24 KB

README.md

File metadata and controls

93 lines (76 loc) · 2.24 KB

Note: This repo is managed by the VSP-Identity team. Please reference our main product page here for contact information and questions.

Sign-in Service Example App

An example app built with Sinatra that interfaces with Sign-in Service.

Dependencies

  • Ruby 3.2.1

Configuration

Config the Sign-in Service Server

Currently, SignInService is available as a part of vets-api

  1. Clone Repo
  git clone [email protected]:department-of-veterans-affairs/vets-api.git
  1. Follow setup instructions for vets-api
  2. Ensure your database is prpoerly seeded rails db:seed this will add the necessary client configurations

Configure the SignInService client

This application uses the SignInService Ruby Client

  1. You will see the base config in .env (these match the default client config in vets-api)
  # .env
  SIS_CLIENT_ID='sample_client_web'
  SIS_BASE_URL='http://localhost:3000'
  SIS_AUTH_TYPE='cookie'
  1. The default auth type for this app is cookie. If you want to use api change your config in .env.local to the correct client and auth_type.
  # .env.local
  SIS_CLIENT_ID='sample_client_api'
  SIS_BASE_URL='http://localhost:3000'
  SIS_AUTH_TYPE='api'
  1. Configure the SignInServiceClient in config.ru.
  # config.ru
  SignInService.configure do |config|
    config.base_url = ENV.fetch('SIS_BASE_URL')
    config.client_id = ENV.fetch('SIS_CLIENT_ID')
    config.auth_type = ENV.fetch('SIS_AUTH_TYPE').to_sym
  end
  1. Start the Sign-in Service server (vets-api)
  vets-api % rails s

Running the Example app

Native

Setup the app:

bin/setup

Start the server:

bin/server

By default the server will be running on http://localhost:4567

Docker

Build image and start container

bin/up

The server will be running on http://localhost:4567

Remove container and cleanup

bin/down

Development

Testing

To run the the rspec test suite:

bin/test

Linting

To run the rubocop linter:

bin/lint