Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

viisp-auth-custom

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

viisp-auth-custom

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

VIISP::Auth

Gem Version Build Status

Lithuanian E-Government Gateway "Elektroniniai valdžios vartai" identity service client.

VIISP identity service documentation: https://www.epaslaugos.lt/portal/content/1257

Installation

Add this line to your application's Gemfile:

gem 'viisp-auth'

Configuration

VIISP::Auth.configure do |c|
  c.pid = '1234'
  c.private_key = OpenSSL::PKey::RSA.new(File.read('your-private-key.pem'))
  c.postback_url = 'https://localhost'

  # optional
  c.providers = %w[auth.lt.identity.card auth.lt.bank]
  c.attributes = %w[lt-personal-code lt-company-code] 
  c.user_information = %w[firstName lastName companyName email]

  # enable test mode
  # (in test mode there is no need to set pid and private_key)
  c.test = true
end

Usage

Get an authentication ticket:

ticket = VIISP::Auth.ticket

Redirected user to authentication portal with ticket using http POST. VIISP::Auth.portal_endpoint is a convenience method to get portal URL.

Redirect form for testing: https://jsfiddle.net/kmrzpqwk/

After successful authentication identity data can be fetched once.

identity = VIISP::Auth.identity(
  ticket: ticket,
  include_source_data: true,
)

Identity example:

{
  "authentication_provider" => "auth.lt.bank",
  "attributes" => {
    "lt-personal-code" => "XXXXXXXXXXX"
  },
  "user_information" => {
    "firstName" => "VARDENIS",
    "lastName" => "PAVARDENIS",
    "companyName" => nil
  },
  "custom_data" => "correlation-123",
  "source_data" => {
    "type" => "BANKLINK",
    "parameters" => {
      "VK_USER" => "12345678900",
      "VK_TIME" => "08:57:29"
    }
  }
}

Ticket arguments

You can pass custom_data and override some configuration attributes when requesting ticket.

ticket = VIISP::Auth.ticket(
  custom_data: 'custom data',
  postback_url: 'https://localhost',
  providers: %w[auth.lt.identity.card auth.lt.bank],
  attributes: %w[lt-personal-code lt-company-code],
  user_information: %w[firstName lastName companyName email],
)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/laurynas/viisp-auth. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the VIISP::Auth project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

FAQs

Package last updated on 29 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc