omniauth-saml-rmunify 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZGYyZTEwMzliMWZiZTNlMmRhYzE5M2Q5Y2VjOWMxNjEyZWNlMDA5OA==
5
+ data.tar.gz: !binary |-
6
+ ZTE2Zjk5MzE2OTY0ZTY5OWY1YjIwOWI3MTllY2JmMDQ4NGQ4YjUyNw==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ MjJiMzk2Y2VhNjVlMDIyYjRkMTM4MmI5Zjc5OWUwMjAwNDkwNjc4ZWNhOTMz
10
+ MWVmZGE2ZTk5MWQxMWUyMmI2MzNmOGE1NjIwMzI5MzFiZDFhMTQwM2IyZjQw
11
+ ZDllODA0YWI2OTE4NjI0MDgyZjExMmVhMTA3MjEzMmQ1NDhiNDI=
12
+ data.tar.gz: !binary |-
13
+ OTZmMTkzYjY0ODkxZTFiMzNmZGZhY2UwNjI3ZjUzYjJjOGE2NjQ2OTczNTg3
14
+ NTJmYmRhZTA3NGUyNjdlZWNmZWJhY2FjMjhmNzEzMGQxNjVlYjI2NjFhOWZm
15
+ ZjkzZWY5MzYyN2Q1Nzc4OTNkYWI5ZDFjNjE1YzI0MTYzOTUzYTA=
@@ -0,0 +1,12 @@
1
+ # OmniAuth SAML RM Unify Version History
2
+
3
+ An RM Unify SAML strategy for OmniAuth.
4
+
5
+ https://github.com/hampei/omniauth-saml-rmunify
6
+
7
+ ## master
8
+
9
+
10
+ ## 1.0.0 (2014-02-15)
11
+
12
+ * initial release
@@ -0,0 +1,67 @@
1
+ # OmniAuth SAML RM Unify
2
+
3
+ An RM Unify SAML strategy for OmniAuth.
4
+
5
+ https://github.com/hampei/omniauth-saml-rmunify
6
+
7
+ * It's a simple subclass of omniauth-saml with a rm unify specific info hash.
8
+ * Take a look at [rm attributes](http://dev.rmunify.com/reference/understanding-rm-unify/user-attributes.aspx) for descriptions.
9
+ * The attribute names have been taken from the manage-app/single-sign-on/saml-p page, underscored for you convenience.
10
+ * Read the [list of info attributes](https://github.com/hampei/omniauth-saml-rmunify/blob/master/lib/omniauth/strategies/saml-rmunify.rb) for what is available.
11
+
12
+ ## Requirements
13
+
14
+ * [omniauth-saml](https://github.com/PracticallyGreen/omniauth-saml) '~> 1.1.0'
15
+
16
+ ## Usage
17
+
18
+ See omniauth-saml for more options.
19
+
20
+ In your Rails application:
21
+
22
+ in `Gemfile`:
23
+
24
+ ```ruby
25
+ gem 'omniauth-saml-rmunify'
26
+ ```
27
+
28
+ and in `config/initializers/omniauth.rb`:
29
+
30
+ ```ruby
31
+ Rails.application.config.middleware.use OmniAuth::Builder do
32
+ provider :saml_rmunify,
33
+ assertion_consumer_service_url: "https://#{app_host}/users/auth/saml_rmunify/callback",
34
+ issuer: "https://#{app_host}/rmunify",
35
+ idp_sso_target_url: "https://sts.platform.rmunify.com/issue/saml/?binding=redirect",
36
+ idp_cert_fingerprint: "66:cb:2d:02:cd:81:f1:b1:03:22:6b:a0:21:cd:8e:69:0c:5e:f4:25",
37
+ end
38
+ ```
39
+
40
+ ## Authors
41
+
42
+ Authored by Henk van der Veen.
43
+
44
+ Maintained by [Henk van der Veen](http://hampei.github.io/).
45
+
46
+ ## License
47
+
48
+ Copyright (c) 2014 [Henk van der Veen IT.](http://hampei.github.io/).
49
+ All rights reserved. Released under the MIT license.
50
+
51
+ Permission is hereby granted, free of charge, to any person obtaining a copy
52
+ of this software and associated documentation files (the "Software"), to deal
53
+ in the Software without restriction, including without limitation the rights
54
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
55
+ copies of the Software, and to permit persons to whom the Software is
56
+ furnished to do so, subject to the following conditions:
57
+
58
+ The above copyright notice and this permission notice shall be included in
59
+ all copies or substantial portions of the Software.
60
+
61
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
62
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
63
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
64
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
65
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
66
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
67
+ THE SOFTWARE.
@@ -0,0 +1 @@
1
+ require 'omniauth/strategies/saml-rmunify'
@@ -0,0 +1,5 @@
1
+ module OmniAuth
2
+ module SAMLRMUnify
3
+ VERSION = '1.0.0'
4
+ end
5
+ end
@@ -0,0 +1,46 @@
1
+ require 'omniauth-saml'
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class SAMLRMUnify < SAML
6
+
7
+ option :name, "saml_rmunify"
8
+
9
+ info do
10
+ {
11
+ :email => @attributes['urn:oid:0.9.2342.19200300.100.1.3'],
12
+ :name => @attributes['urn:oid:2.16.840.1.113730.3.1.241'] ||
13
+ @attributes['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name'] ||
14
+ @attributes['urn:oid:2.5.4.42'] + ' ' + @attributes['urn:oid:2.5.4.4'],
15
+ :nickname => @attributes['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name'],
16
+ :first_name => @attributes['urn:oid:2.5.4.42'],
17
+ :last_name => @attributes['urn:oid:2.5.4.4'],
18
+ # underscore version of rm unify attribute names.
19
+ :display_name => @attributes['urn:oid:2.16.840.1.113730.3.1.241'],
20
+ :user_name => @attributes['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name'],
21
+ :persistent_id => @attributes['urn:oasis:names:tc:SAML:2.0:nameid-format:persistent'],
22
+ :identity_guid => @attributes['http://schemas.rm.com/identity/claims/identityguid'],
23
+ :scope_targeted_id => @attributes['urn:mace:dir:attribute-def:eduPersonTargetedID'],
24
+ :organization_guid => @attributes['http://schemas.rm.com/identity/claims/organisationid'],
25
+ :organization_name => @attributes['urn:oid:2.5.4.10'],
26
+ :organization_code => @attributes['http://schemas.rm.com/identity/claims/organisationCode'],
27
+ :display_name => @attributes['urn:oid:2.16.840.1.113730.3.1.241'],
28
+ :role => @attributes['http://schemas.microsoft.com/ws/2008/06/identity/claims/role'],
29
+ :scope_affiliation => @attributes['urn:oid:1.3.6.1.4.1.5923.1.1.1.9'],
30
+ :is_unify_admin => @attributes['http://schemas.rm.com/identity/claims/isunifyadmin'],
31
+ :year_of_entry => @attributes['http://schemas.rm.com/identity/claims/yearofentry'],
32
+ :app_licence => licence,
33
+ :app_user_id => @attributes['http://schemas.rm.com/identity/claims/appuserid'],
34
+ :app_establishment_key => @attributes['http://schemas.rm.com/identity/claims/appestablishmentkey']
35
+ }
36
+ end
37
+
38
+ private def licence
39
+ licence_str = @attributes['http://schemas.rm.com/identity/claims/applicence']
40
+ licence = Hash[licence_str[1..-2].split('|').map{|kv| kv.split(':')}]
41
+ end
42
+ end
43
+ end
44
+ end
45
+
46
+ OmniAuth.config.add_camelization 'saml_rmunify', 'SAMLRMUnify'
metadata ADDED
@@ -0,0 +1,63 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-saml-rmunify
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Henk van der Veen
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-02-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: omniauth-saml
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 1.1.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 1.1.0
27
+ description: An RMUnify SAML strategy for OmniAuth.
28
+ email: henk.van.der.veen@gmail.com
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - README.md
34
+ - CHANGELOG.md
35
+ - lib/omniauth/strategies/saml-rmunify.rb
36
+ - lib/omniauth-saml-rmunify/version.rb
37
+ - lib/omniauth-saml-rmunify.rb
38
+ homepage: https://github.com/hampei/omniauth-saml-rmunify
39
+ licenses:
40
+ - MIT
41
+ metadata: {}
42
+ post_install_message:
43
+ rdoc_options: []
44
+ require_paths:
45
+ - lib
46
+ required_ruby_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ! '>='
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ required_rubygems_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ requirements: []
57
+ rubyforge_project:
58
+ rubygems_version: 2.1.10
59
+ signing_key:
60
+ specification_version: 4
61
+ summary: A custom info auth hash translating the rm unify attributes. Subclass of
62
+ omniauth-saml.
63
+ test_files: []