Azure AD Authentication for Oracle APEX Applications : Social Sign In
This article describes the setup of social sign in to enable Azure AD authentication of APEX applications.
oracle miscconfigurationintermediate
by OracleDba
16 views
This article describes the setup of social sign in to enable Azure AD authentication of APEX applications.
1234567891011121314
https://login.microsoftonline.com/
https://graph.microsoft.com/v1.0/me
https://www.office.com/
mkdir -p /home/oracle/wallet
cd /home/oracle/wallet
orapki wallet create -wallet /home/oracle/wallet -pwd MyWalletPassword -auto_login
$ORACLE_HOME/bin/orapki wallet add -wallet /home/oracle/wallet \
-trusted_cert -cert "/tmp/digicert-root.cer" -pwd MyWalletPassword
$ORACLE_HOME/bin/orapki wallet add -wallet /home/oracle/wallet \
-trusted_cert -cert "/tmp/digicert-root2.cer" -pwd MyWalletPassword12345678910111213141516171819
declare
l_username varchar2(30) := 'APEX_200200';
begin
dbms_network_acl_admin.append_host_ace(
host => 'login.microsoftonline.com',
lower_port => 443,
ace => xs$ace_type(privilege_list => xs$name_list('connect'),
principal_name => l_username,
principal_type => xs_acl.ptype_db));
dbms_network_acl_admin.append_host_ace(
host => 'graph.microsoft.com',
lower_port => 443,
ace => xs$ace_type(privilege_list => xs$name_list('connect'),
principal_name => l_username,
principal_type => xs_acl.ptype_db));
commit;
end;
/12345678910111213141516171819202122
procedure post_authenticate is
l_clob clob;
begin
-- Defaults
:AD_FIRSTNAME := apex_json.get_varchar2('givenName');
:AD_LASTNAME := apex_json.get_varchar2('surname');
:AD_EMAIL := apex_json.get_varchar2('mail');
-- Custom
begin
l_clob := apex_web_service.make_rest_request(
p_url => 'https://graph.microsoft.com/v1.0/me?$select=onPremisesSamAccountName',
p_http_method => 'GET'
);
:AD_GRAPHQL := l_clob;
:AD_USERNAME := json_value(l_clob, '$.onPremisesSamAccountName');
exception
when others then
:AD_GRAPHQL := dbms_utility.format_error_backtrace;
:AD_USERNAME := null;
end;
end post_authenticate;Please to add comments
No comments yet. Be the first to comment!