Skip to Main Content

ORDS, SODA & JSON in the Database

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Invoke APEX_UTIL.IS_LOGIN_PASSWORD_VALID from ORDS RESTful modules handlers

Mahmoud_RabieJul 7 2017 — edited Jul 8 2017

Hello Experts

Given:

- Hybrid Mobile Application exchange data securely with ORDS RESTful modules.

Goal:

- Manage users from Apex environment not by writing and securing custom table and custom authentication schemes.

- Invoke APEX_UTIL.IS_LOGIN_PASSWORD_VALID from ORDS RESTful modules handlers (GET, POST, PUT, DELETE).

Obstacle:

IS_LOGIN_PASSWORD_VALID Function

This function returns a Boolean result based on the validity of the password for a named user account in the current workspace. This function returns TRUE if the password matches and it returns FALSE if the password does not match.

ORDS Context != APEX context

I would appreciate any solution or workaround.

Regards

Mahmoud

This post has been answered by Mahmoud_Rabie on Jul 8 2017
Jump to Answer

Comments

Mahmoud_Rabie
Answer

Finally, found the solution in this nice article

https://gerardnico.com/wiki/apex/security_group

I hope the following function helps someone

create or replace FUNCTION  "IS_VALIDUSER"(

          p_workspace in VARCHAR2,

          in_username in VARCHAR2,

          in_password in VARCHAR2)

return NUMBER

is

  l_workspace_id      NUMBER;

begin

    l_workspace_id := apex_util.find_security_group_id (p_workspace => p_workspace);

    apex_util.set_security_group_id (p_security_group_id => l_workspace_id);

  

    if(APEX_UTIL.IS_LOGIN_PASSWORD_VALID(in_username,in_password) ) then

        return 1;

    else

        return 0;

    end if;

end;

Regards

Mahmoud

Marked as Answer by Mahmoud_Rabie · Sep 27 2020
1 - 1
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 5 2017
Added on Jul 7 2017
1 comment
276 views