Reputation: 37
I am Developing a Small ERP in oracle Apex 18.2 I want to Implement a Custom Security as Listed Below
1) User Should Authenticate from Custom Table
2) After Authentication User should be authorize to application as per Assigned Role in Custom Table
3) User Must have Authorize for READ,INSERT,UPDATE and DELETE Operation from Table
As Example Image
I have done some googling but lot of confusing options as per my little knowledge , need recommendations and Suggestion.
Upvotes: 0
Views: 3654
Reputation: 904
1) User Should Authenticate from Custom Table
Custom
.Below is the sample code available and copied from the help text in the Page Builder:
function my_authentication (
p_username in varchar2,
p_password in varchar2 )
return boolean
is
l_user my_users.user_name%type := upper(p_username);
l_pwd my_users.password%type;
l_id my_users.id%type;
begin
select id , password
into l_id, l_pwd
from my_users
where user_name = l_user;
return l_pwd = rawtohex(sys.dbms_crypto.hash (
sys.utl_raw.cast_to_raw(p_password||l_id||l_user),
sys.dbms_crypto.hash_sh512 ));
exception
when NO_DATA_FOUND then return false;
end;
my_authentication
2) After Authentication User should be authorize to application as per Assigned Role in Custom Table
post_login
, that retrieves the user's role and either adds them to an Application Item or to an APEX collection.post_login
.OR
Simply create an Authorization Scheme that simply queries the same information on the fly, though there's probably a small performance hit depending on how often these authorizations are called.
3) User Must have Authorize for READ,INSERT,UPDATE and DELETE Operation from Table
Upvotes: 5