Class: OracleEbsAuthentication::Authenticator

Inherits:
Object
  • Object
show all
Defined in:
lib/oracle_ebs_authentication/authenticator.rb

Instance Method Summary collapse

Constructor Details

#initializeAuthenticator

Returns a new instance of Authenticator.



5
6
7
# File 'lib/oracle_ebs_authentication/authenticator.rb', line 5

def initialize
  @security = OracleEbsAuthentication::Security.new
end

Instance Method Details

#get_fnd_password(username, password) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/oracle_ebs_authentication/authenticator.rb', line 9

def get_fnd_password(username, password)
  username &&= username.upcase
  result = plsql.apps.fnd_security_pkg.fnd_encrypted_pwd(username, nil, nil, nil)
  if result[:p_password]
    @security.decrypt(username + "/" + password, result[:p_password], false)
  end
rescue OCIError
  nil
end

#validate_user_password(username, password) ⇒ Object



19
20
21
22
23
# File 'lib/oracle_ebs_authentication/authenticator.rb', line 19

def validate_user_password(username, password)
  if username && password
    !! get_fnd_password(username, password)
  end
end