Low commit activity in last 3 years
No release in over a year
OmniAuth strategy for Swedbank Banklink
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 0
~> 2.1
 Project Readme

Omniauth Swedbank

Omniauth strategy for using Swedbank as an authentication service provider.

Supported Ruby versions: 2.7+

Related projects

Installation

Add these lines to your application's Gemfile (omniauth-rails_csrf_protection is required if using Rails):

gem 'omniauth-rails_csrf_protection'
gem 'omniauth-swedbank'

And then execute:

$ bundle

Or install it yourself as:

$ gem install omniauth-rails_csrf_protection omniauth-swedbank

Usage

Here's a quick example, adding the middleware to a Rails app in config/initializers/omniauth.rb:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :swedbank,
    File.read("path/to/private.key"),
    File.read("path/to/bank.crt"),
    ENV['SWEDBANK_SND_ID'],
    ENV['SWEDBANK_REC_ID']
end

Auth Hash

Here's an example Auth Hash available in request.env['omniauth.auth']:

{
  provider: 'swedbank',
  uid: '374042-80367',
  info: {
    full_name: 'ARNIS RAITUMS'
  },
  extra: {
    raw_info: {
      VK_SERVICE: '3003',
      VK_VERSION: '008',
      VK_SND_ID: 'HP',
      VK_REC_ID: 'MPLMT',
      VK_NONCE: '20170425114529204413',
      VK_INFO: 'ISIK:090482-12549;NIMI:DACE ĀBOLA',
      VK_MAC: 'qrEMRf6YV...',
      VK_ENCODING: 'UTF-8
    }
  }
}

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request