From 6c35e3f8369ba96cb251eac487424bd949fdcf6c Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Tue, 2 Jul 2013 19:23:01 +0200 Subject: Algorithms and Models are modules instead of classes. --- lib/authorization.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/authorization.rb') 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" -- cgit v1.2.3