1 Reply Latest reply: Feb 1, 2013 12:07 PM by 988139 RSS

    Custom Authentication Scheme Authenticate Parameters Help

      Hello, Im trying to do a custom authentication scheme through a webservice, here is my function, everything works but even if I put the right credentials it fails to login, If I hard code the credentials to the envelope it works fine but if I try to pass them as parameters it fails, I think the only problem is that it is not getting the values of the parameters (username, password) I don´t know why in every blog I have read this is the way they do it here is my function code

      FUNCTION authenticate(p_username IN VARCHAR2,p_password IN VARCHAR2)
      l_envelope CLOB;
      l_xml XMLTYPE;
      l_result VARCHAR2(10);
      l_pass VARCHAR2(10);
      l_pass := 'true';
      l_envelope := '<?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <ValidateUser xmlns="http://tempuri.org/">

      l_xml := apex_web_service.make_request(
      p_url => '',
      p_action => 'http://tempuri.org/ValidateUser',
      p_envelope => l_envelope

      l_result := apex_web_service.parse_xml(
      p_xml => l_xml,
      p_xpath => '//ValidateUserResponse/ValidateUserResult/text()',
      p_ns => ' xmlns="http://tempuri.org/"' );

      IF l_result = l_pass THEN
      RETURN true;
      RETURN false;
      END IF;
      END authenticate;

      If i replace p_username and p_password with hardcoded valid credentials everything works fine, but I need to pass the values as the function parameters.

      Please Help

      Thanks in advance.