3 Replies Latest reply: Feb 7, 2013 12:57 PM by Denes Kubicek RSS

    Error after implementing custom authentication scheme

    Goggin
      I've replicated this in both a workspace (GOGGINSCRATCH in apex.oracle.com) running 4.2.1.00.08 and a workspace running 4.1.1.00.23

      Error: ORA-06550: line 4, column 23: PLS-00306: wrong number or types of arguments in call to 'AUTHENTICATOR' ORA-06550: line 4, column 1: PL/SQL: Statement ignored

      PL/SQL in my workspace

      create or replace PACKAGE REPORTINGAUT AS

      function authenticator( user_name in VARCHAR2, pwd in VARCHAR2 )
      return boolean;

      END REPORTINGAUT;

      create or replace PACKAGE BODY REPORTINGAUT AS

      function authenticator( user_name in VARCHAR2, pwd in VARCHAR2 )
      return boolean AS
      BEGIN
      /* TODO implementation required */
      RETURN TRUE;
      END authenticator;

      END REPORTINGAUT;

      ------------------------------------
      Steps in APEX Application Builder
      1) Shared Components
      2) Authentication Schemes
      3) Create
      4.a) Based on a pre-configured scheme from the gallery
      4.b) name it fred
      4.c) Type == custom
      4.d) Authentication Function Name = ReportingAut.authenticator
      4.e) Enable Legacy Authentication Attributes == Yes +(I've tried it both ways)+

      So... this scheme is current, but when I attempt to log in, I get the above error... Driving me crazy... Thanks for any help...
        • 1. Re: Error after implementing custom authentication scheme
          Denes Kubicek
          Parameter naming is important. This should work:
          CREATE OR REPLACE PACKAGE reportingaut
          AS
             FUNCTION authenticator (p_username IN VARCHAR2, p_password IN VARCHAR2)
                RETURN BOOLEAN;
          END reportingaut;
          
          CREATE OR REPLACE PACKAGE BODY reportingaut
          AS
             FUNCTION authenticator (p_username IN VARCHAR2, p_password IN VARCHAR2)
                RETURN BOOLEAN
             AS
             BEGIN
                RETURN TRUE;
             END authenticator;
          END reportingaut;
          Denes Kubicek
          -------------------------------------------------------------------
          http://deneskubicek.blogspot.com/
          http://www.apress.com/9781430235125
          http://apex.oracle.com/pls/apex/f?p=31517:1
          http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
          -------------------------------------------------------------------
          • 2. Re: Error after implementing custom authentication scheme
            Goggin
            Thanks... that worked. I don't know why naming the variables that way is important, but I'll find out someday, I suppose.
            • 3. Re: Error after implementing custom authentication scheme
              Denes Kubicek
              In your authentication you say something like this:
              RETURN authenticator;
              You do not name the parameters and this functionality is generic. It will know which items to take and to parse. The only thing is that the input parameters have to be named according to what I posted.

              Denes Kubicek
              -------------------------------------------------------------------
              http://deneskubicek.blogspot.com/
              http://www.apress.com/9781430235125
              http://apex.oracle.com/pls/apex/f?p=31517:1
              http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
              -------------------------------------------------------------------