SAML認証のデバッグで使用した、いくつかの手順を紹介します。
公開鍵証明書の確認
set serveroutput on | |
declare | |
l_cert varchar2(32767); | |
begin | |
l_cert := q'~ | |
-----BEGIN CERTIFICATE----- | |
MIIClzCCAX8CBgGBWpvRHTANBgkqhkiG9w0BAQsFADAPMQ0wCwYDVQQDDARhcGV4 | |
検証する証明書を貼り付ける。 | |
F04IqzTVHoCfuqtrcHVkuGlBCyMEtU0Aafuhkpz4CRMsIEgws2CgSbUJ8S9dNtjk | |
wABHyWhq64wGl7BfEq/utwgkBKdqKcOM9StviMayg9bMsfe2BBfxaO0ZrA== | |
-----END CERTIFICATE----- | |
~'; | |
if | |
wwv_flow_public_key_util.is_certificate(l_cert) | |
then | |
dbms_output.put_line('Certificate is valid.'); | |
else | |
dbms_output.put_line('Certificate is NOT valid.'); | |
end if; | |
end; | |
/ |
set serveroutput on | |
declare | |
l_cert varchar2(32767); | |
l_cert_info wwv_flow_public_key_util.t_cert_info; | |
begin | |
l_cert := q'~ | |
-----BEGIN CERTIFICATE----- | |
MIICuzCCAaOgAwIBAgIUDHbT6l9jzhzdyuwqKAJLnwi/31YwDQYJKoZIhvcNAQEL | |
公開鍵証明書を貼り付ける。 | |
r31APDa1oRH5DwBB8euBn9UNWY4Hs+MmbQu2FmJy0hZMkuE9FLE0/YYwRmTIhWA4 | |
Q6z0qVXrS7e637VQAX3op+Rq0RlyUvIOMAtpsZzAbg== | |
-----END CERTIFICATE----- | |
~'; | |
l_cert_info := wwv_flow_public_key_util.parse_certificate(l_cert,true); | |
dbms_output.put_line('cert_sig_algorithm = ' || | |
case l_cert_info.cert_sig_algorithm | |
when 0 then 'c_sha1_rsa' | |
when 1 then 'c_sha256_rsa' | |
when 2 then 'c_sha386_rsa' | |
when 3 then 'c_sha512_rsa' | |
end | |
); | |
dbms_output.put_line('key_algorithm = ' || l_cert_info.key_algorithm); | |
dbms_output.put_line('key_length = ' || l_cert_info.key_length); | |
end; | |
/ |
SQL> alter session set current_schema = apex_220100;
Session altered.
SQL> @verify-cert
Certificate is valid.
PL/SQL procedure successfully completed.
SQL> @parse-cert
cert_sig_algorithm = c_sha256_rsa
key_algorithm = RSA
key_length = 2048
PL/SQL procedure successfully completed.
SQL>
HARファイルの確認
d0、d1、d2スクリプトの使用
SQL> alter session set current_schema = apex_220100;
Session altered.
SQL> @d0
Changed debug level from "" to "9"
SQL>
SQL> alter session set current_schema = apex_220100;
Session altered.
SQL> @d0
Changed debug level from "" to "9"
SQL> @d0
Changed debug level from "9" to ""
SQL>
PAGE_VIEW_ID STARTED SECS LVL COUNT PATH_INFO APP:PAGE SESSION_ID WORKSPACE USER
------------- -------- ------ --- ------ ---------------------------- ---------- --------------------------------- -------------------- --------------------------------
@d2 8003 06:00:00 0.03 16 DBMS_SCHEDULER/ORACLE_APEX_M 0 Unknown
AIL_QUEUE
@d2 8004 06:00:00 0.01 5 DBMS_SCHEDULER/ORACLE_APEX_W 0 Unknown
S_NOTIFICATIONS
@d2 8005 06:00:02 0.01 9 DBMS_SCHEDULER/ORACLE_APEX_P 0 Unknown
URGE_SESSIONS
@d2 8006 06:00:10 0.20 WRN 220 show 4500:1000 0-16849648434733 INTERNAL nobody
PAGE_VIEW_ID STARTED SECS LVL COUNT PATH_INFO APP:PAGE SESSION_ID WORKSPACE USER
------------- -------- ------ --- ------ ---------------------------- ---------- --------------------------------- -------------------- --------------------------------
@d2 8007 06:00:11 0.72 1610 show 4550:1 0-16849648434733 INTERNAL nobody
@d2 8618 06:00:24 0.18 WRN 315 show 102:1 0-9657959965886 APEXDEV nobody
@d2 8619 06:00:43 0.36 WRN 508 ajax plugin 102:1 0-9657959965886 APEXDEV nobody
30 rows selected.
SQL>
SQL> @d2 8619
画面へのエラー詳細表示
[oracle@apex ~]$ /usr/local/bin/ords --config /etc/ords/config config set debug.printDebugToScreen true
ORDS: Release 22.1 Production on Tue Jun 14 04:39:29 2022
Copyright (c) 2010, 2022, Oracle.
Configuration:
/etc/ords/config/
The global setting named: debug.printDebugToScreen was set to: true
[oracle@apex ~]$
[oracle@ords ords]$ java -jar ords.war set-property debug.printDebugToScreen true
2022-06-14T04:45:10.789Z INFO Modified: /opt/oracle/ords/conf/ords/defaults.xml, setting: debug.printDebugToScreen = true
[oracle@ords ords]$
[oracle@apex ~]$ /usr/local/bin/ords --config /etc/ords/config config delete debug.printDebugToScreen
ORDS: Release 22.1 Production on Tue Jun 14 05:00:18 2022
Copyright (c) 2010, 2022, Oracle.
Configuration:
/etc/ords/config/
The global setting named: debug.printDebugToScreen was removed from the configuration
[oracle@apex ~]$