Forum Stats

  • 3,837,080 Users
  • 2,262,224 Discussions
  • 7,900,199 Comments

Discussions

ERR-1002 Unable to find item ID for item - Custom Login Apex(21.1.0)

Edisson Gabriel López
Edisson Gabriel López Member Posts: 65 Green Ribbon
edited Nov 29, 2021 6:40PM in Packaged Applications

Hi,

When I debug my application and see why I can't login I get the following errors:

And as you can see in the schematic authorizations, I have the following configuration

And in my package (ASERTIA_AUTH_PKG) I have the following :


The idea of this custom login is from the following blog Create a Custom Authentication and Authorization Scheme in Oracle APEX


Answers

  • Rick-Pick
    Rick-Pick Member Posts: 100 Bronze Badge

    Hi - I'm not sure that I'm getting the complete story...do the items AI_USER_ID and AI_TIME_ZONE exist in the Apex application? They can be application or page level items but they obviously have to be there somewhere to receive the output from your procedure.

    By the way, you don't seem to be setting OUT_TIME_ZONE in your procedure. You should set it to something, if only null or a default.

    Rick

  • Edisson Gabriel López
    Edisson Gabriel López Member Posts: 65 Green Ribbon
    edited Nov 29, 2021 7:10PM

    Hi @Rick-Pick,

    I'm not sure, is that the blog says to place it as it is in the image, but I do not know why it places (AI_USER_ID-AI_TIME_ZONE). But he doesn't mention where those parameters come from

    But AI_USER_ID is supposed to get it from the packet

    /* POST_AUTHENTICATE */
    PROCEDURE POST_AUTHENTICATE(
        P_USERNAME  IN VARCHAR2,
        OUT_USER_ID OUT NUMBER,
        OUT_TIME_ZONE OUT VARCHAR2
    )
    IS
      L_ID         NUMBER;
    BEGIN
      SELECT USER_ID
        INTO L_ID
        FROM CRPDTA.F_ASR_USERS
       WHERE UPPER(USER_IDENTITY)    = UPPER(P_USERNAME );
       OUT_USER_ID := L_ID; -- Recover user ID
    
    
    END POST_AUTHENTICATE;
    

    Thx.

  • User_XQ5R0
    User_XQ5R0 Member Posts: 1 Green Ribbon

    Hi!

    You can add the missing variables to your global page, since the post_auth function only updates these.