Oracle Application Express (APEX) : Manage Web Credentials From the Command Line
This article describes how to manage APEX web credentials from the command line.
oracle miscconfigurationintermediate
by OracleDba
15 views
This article describes how to manage APEX web credentials from the command line.
1
conn dev_ws/dev_ws@//localhost:1521/freepdb112345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
set linesize 100
column workspace format a20
column name format a20
column static_id format a20
column credential_type format a30
select workspace,
name,
static_id,
credential_type
from apex_workspace_credentials
order by 1,2;
no rows
SQL>
declare
l_workspace varchar2(30) := 'DEV_WS';
l_cred_name varchar2(30) := 'My Web Credential';
l_static_id varchar2(30) := 'my_web_credential';
l_client_id varchar2(30) := 'sdfg6757fdgddg8d5ffgdg..';
l_secret varchar2(30) := '767978689dfgdf6798876d..';
begin
apex_util.set_workspace(p_workspace => l_workspace);
apex_credential.create_credential (
p_credential_name => l_cred_name,
p_credential_static_id => l_static_id,
p_authentication_type => apex_credential.c_type_oauth_client_cred
);
apex_credential.set_persistent_credentials (
p_credential_static_id => l_static_id,
p_client_id => l_client_id,
p_client_secret => l_secret
);
commit;
end;
/
PL/SQL procedure successfully completed.
SQL>
select workspace,
name,
static_id,
credential_type
from apex_workspace_credentials
order by 1,2;
WORKSPACE NAME STATIC_ID CREDENTIAL_TYPE
-------------------- -------------------- -------------------- ------------------------------
DEV_WS My Web Credential my_web_credential OAuth2 Client Credentials flow
SQL>123456789101112131415161718
conn sys/SysPassword1@//localhost:1521/freepdb1 as sysdba
set linesize 100
column name format a20
column client_id format a30
column client_secret format a40
select name,
client_id,
client_secret
from apex_240200.wwv_credentials
order by 1;
NAME CLIENT_ID CLIENT_SECRET
-------------------- ------------------------------ ----------------------------------------
My Web Credential sdfg6757fdgddg8d5ffgdg.. ShRSHR/UO74I2ZQWaFlV7Dypvn//WDPM
SQL>12345678910111213141516171819
conn dev_ws/Dev1Workspace2!@//localhost:1521/freepdb1
declare
l_workspace varchar2(30) := 'DEV_WS';
l_static_id varchar2(30) := 'my_web_credential';
l_client_id varchar2(30) := 'sdfg6757fdgddg8d5ffgdg..';
l_secret varchar2(30) := '4567575ijyugu565675675..';
begin
apex_util.set_workspace(p_workspace => l_workspace);
apex_credential.set_persistent_credentials (
p_credential_static_id => l_static_id,
p_client_id => l_client_id,
p_client_secret => l_secret
);
commit;
end;
/Please to add comments
No comments yet. Be the first to comment!