pax_global_header 0000666 0000000 0000000 00000000064 12544305334 0014515 g ustar 00root root 0000000 0000000 52 comment=9c1ad34fa292d2dcc4f97a9b260638c46b16513d omniauth-kerberos-0.3.0/ 0000775 0000000 0000000 00000000000 12544305334 0015153 5 ustar 00root root 0000000 0000000 omniauth-kerberos-0.3.0/.gitignore 0000664 0000000 0000000 00000000232 12544305334 0017140 0 ustar 00root root 0000000 0000000 *.gem *.rbc .bundle .config .yardoc Gemfile.lock InstalledFiles _yardoc coverage doc/ lib/bundler/man pkg rdoc spec/reports test/tmp test/version_tmp tmp omniauth-kerberos-0.3.0/.travis.yml 0000664 0000000 0000000 00000000427 12544305334 0017267 0 ustar 00root root 0000000 0000000 sudo: false language: ruby cache: bundler rvm: - '2.1' - '2.0' - 1.9.3 - rbx-2 env: global: secure: GFgbyRIlAc93IyH5clByNGS9iI/5OSaa2Ba0iGemyLR93I80qxIUNgMvXzp74YTTbGTrWyz9JPBSD14uO/3tuPYhXuawbDT0k1D/97Xm7wMhxLXZNSEATKt71g3bk/106fy+ULz6aqzQWnLkGHsvfg3vlkdyn8rX/X1HstajrcI= omniauth-kerberos-0.3.0/Gemfile 0000664 0000000 0000000 00000000256 12544305334 0016451 0 ustar 00root root 0000000 0000000 source 'https://rubygems.org' # Specify your gem's dependencies in omniauth-kerberos.gemspec gemspec gem 'rake' gem 'rspec' gem 'rack-test' gem 'codeclimate-test-reporter' omniauth-kerberos-0.3.0/LICENSE 0000664 0000000 0000000 00000002054 12544305334 0016161 0 ustar 00root root 0000000 0000000 Copyright (c) 2012 Jan Graichen MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. omniauth-kerberos-0.3.0/README.md 0000664 0000000 0000000 00000003460 12544305334 0016435 0 ustar 00root root 0000000 0000000 # Omniauth::Strategies::Kerberos [](https://travis-ci.org/jgraichen/omniauth-kerberos) [](https://codeclimate.com/github/jgraichen/omniauth-kerberos) [](https://codeclimate.com/github/jgraichen/omniauth-kerberos/coverage) **omniauth-kerberos** is a simple [OmniAuth](https://github.com/intridea/omniauth) strategy to authenticate using a Kerberos server. **omniauth-kerberos** can be used as an authenticator for [OmniAuth MultiPassword](https://github.com/jgraichen/omniauth-multipassword). ## Installation Add this line to your application's Gemfile: gem 'omniauth-kerberos' And then execute: $ bundle Or install it yourself as: $ gem install omniauth-kerberos Kerberos development headers are required to build dependencies. On Debian try: $ sudo apt-get install libkrb5-dev ## Usage Use **omniauth-kerberos** like any other OmniAuth strategy: ```ruby Rails.application.config.middleware.use OmniAuth::Builder do provider :kerberos end ``` You still need to configure your system for Kerberos usage like specifying realms. If you has your own login form you can specify the fields to use: ```ruby Rails.application.config.middleware.use OmniAuth::Builder do provider :kerberos, :fields => [ :login, :pwd ] end ``` ## Options ** title ** The title text shown on default login form. (default: `"Restricted Access"`) ** fields ** The request parameter names to fetch username and password. (default: `[ "username", "password" ]`) ## License [MIT License](http://www.opensource.org/licenses/mit-license.php) Copyright (c) 2012, Jan Graichen omniauth-kerberos-0.3.0/Rakefile 0000664 0000000 0000000 00000000205 12544305334 0016615 0 ustar 00root root 0000000 0000000 #!/usr/bin/env rake require 'bundler/gem_tasks' require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) task default: :spec omniauth-kerberos-0.3.0/lib/ 0000775 0000000 0000000 00000000000 12544305334 0015721 5 ustar 00root root 0000000 0000000 omniauth-kerberos-0.3.0/lib/omniauth-kerberos.rb 0000664 0000000 0000000 00000000047 12544305334 0021705 0 ustar 00root root 0000000 0000000 require 'omniauth/strategies/kerberos' omniauth-kerberos-0.3.0/lib/omniauth/ 0000775 0000000 0000000 00000000000 12544305334 0017545 5 ustar 00root root 0000000 0000000 omniauth-kerberos-0.3.0/lib/omniauth/strategies/ 0000775 0000000 0000000 00000000000 12544305334 0021717 5 ustar 00root root 0000000 0000000 omniauth-kerberos-0.3.0/lib/omniauth/strategies/kerberos.rb 0000664 0000000 0000000 00000001156 12544305334 0024063 0 ustar 00root root 0000000 0000000 require 'omniauth' require 'krb5_auth' require 'omniauth/multipassword/base' module OmniAuth module Strategies class Kerberos include OmniAuth::Strategy include OmniAuth::MultiPassword::Base def initialize(app, *args, &block) super @krb5 = ::Krb5Auth::Krb5.new end info do { username: username, email: username + '@' + @krb5.get_default_realm.downcase } end def authenticate(username, password) @krb5.get_init_creds_password(username, password) rescue ::Krb5Auth::Krb5::Exception false end end end end omniauth-kerberos-0.3.0/omniauth-kerberos.gemspec 0000664 0000000 0000000 00000001360 12544305334 0022156 0 ustar 00root root 0000000 0000000 # -*- encoding: utf-8 -*- Gem::Specification.new do |gem| gem.authors = ['Jan Graichen'] gem.email = ['jan.graichen@altimos.de'] gem.description = 'An OmniAuth strategy for Kerberos.' gem.summary = 'An OmniAuth strategy for Kerberos.' gem.homepage = 'https://github.com/jgraichen/omniauth-kerberos' gem.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) } gem.files = `git ls-files`.split("\n") gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") gem.name = 'omniauth-kerberos' gem.require_paths = ['lib'] gem.version = '0.3.0' gem.add_dependency 'timfel-krb5-auth', '~> 0.8' gem.add_dependency 'omniauth-multipassword' end omniauth-kerberos-0.3.0/spec/ 0000775 0000000 0000000 00000000000 12544305334 0016105 5 ustar 00root root 0000000 0000000 omniauth-kerberos-0.3.0/spec/omniauth/ 0000775 0000000 0000000 00000000000 12544305334 0017731 5 ustar 00root root 0000000 0000000 omniauth-kerberos-0.3.0/spec/omniauth/strategy/ 0000775 0000000 0000000 00000000000 12544305334 0021573 5 ustar 00root root 0000000 0000000 omniauth-kerberos-0.3.0/spec/omniauth/strategy/kerberos_spec.rb 0000664 0000000 0000000 00000002367 12544305334 0024756 0 ustar 00root root 0000000 0000000 require 'spec_helper' require 'rack/test' describe OmniAuth::Strategies::Kerberos do include Rack::Test::Methods before do fake = double 'krb5' allow(::Krb5Auth::Krb5).to receive(:new).and_return fake allow(fake).to receive(:get_default_realm).and_return 'example.org' allow(fake).to receive(:get_init_creds_password) do |username, password| if username == 'john' && password == 'secret' true else fail ::Krb5Auth::Krb5::Exception end end end let(:app) do Rack::Builder.new do use OmniAuth::Test::PhonySession use OmniAuth::Strategies::Kerberos run ->(env) { [404, {}, [env['omniauth.auth']['uid'].to_s]] } end.to_app end it 'shows login FORM' do get '/auth/kerberos' expect(last_response.body).to include '