diff options
author | Christoph Helma <helma@in-silico.ch> | 2013-07-02 19:23:01 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2013-07-02 19:23:01 +0200 |
commit | 6c35e3f8369ba96cb251eac487424bd949fdcf6c (patch) | |
tree | efb13808cfd022793800460a729bf0b583284d21 /lib/authorization.rb | |
parent | 308ed58dc56815317f89654a0cc4ab7fb70a9f31 (diff) |
Algorithms and Models are modules instead of classes.
Diffstat (limited to 'lib/authorization.rb')
-rw-r--r-- | lib/authorization.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/authorization.rb b/lib/authorization.rb index 7f0e840..4b63cef 100644 --- a/lib/authorization.rb +++ b/lib/authorization.rb @@ -1,6 +1,12 @@ module OpenTox - AA = $aa[:uri] if defined? $aa - AA ||= "https://opensso.in-silico.ch" #if not set in .opentox/conf/[SERVICE].rb + if defined?($aa) and $aa[:uri] + AA = $aa[:uri] + SUBJECTID = OpenTox::Authorization.authenticate($aa[:user],$aa[:password]) + unauthorized_error "Failed to authenticate user \"#{$aa[:user]}\"." unless OpenTox::Authorization.is_token_valid(SUBJECTID) + else + AA = "https://opensso.in-silico.ch" #if not set in .opentox/conf/[SERVICE].rb + SUBJECTID = nil + end #Module for Authorization and Authentication #@example Authentication # require "opentox-client" |