Cleaning up an old laptop, so moving some stuff what still might be useful for others to github. See https://t.co/mr2QzwLSlG #orclAPEX #passkeys #WebAuthn
— Anton Scheffer (@AntonScheffer) August 26, 2025
自動的に選択されているオプションは変更は不要なので、そのままアプリケーションのインストールをクリックします。
- 最初にスキーム・タイプが公開資格証明(ユーザー名だけで認証するテスト用の認証手段)またはOracle APEXアカウントでユーザー認証をします。
- 1でユーザー認証したデバイスでパスキーを登録します。
- この後から、同じデバイスであればパスキーでユーザー認証できます。
create table as_user_passkeys
( id number generated always as identity constraint as_user_passkeys2_pk primary key
, workspace_id number not null
, app_id number not null
, name varchar2(4000 char) not null
, extra varchar2(4000 char)
, passkeys clob
)
create or replace package as_passkeys
is
function get_version
return varchar2;
function render
( p_dynamic_action apex_plugin.t_dynamic_action
, p_plugin apex_plugin.t_plugin
)
return apex_plugin.t_dynamic_action_render_result;
function ajax
( p_dynamic_action apex_plugin.t_dynamic_action
, p_plugin apex_plugin.t_plugin
)
return apex_plugin.t_dynamic_action_ajax_result;
function verify_authentication( p_username varchar2 )
return boolean;
function passkey_authentication
( p_username varchar2
, p_password varchar2
)
return boolean;
end as_passkeys;
function init_plugin_and_render
( p_dynamic_action apex_plugin.t_dynamic_action
, p_plugin apex_plugin.t_plugin
)
return apex_plugin.t_dynamic_action_render_result
is
l_rv apex_plugin.t_dynamic_action_render_result;
begin
if init_table and init_package( p_plugin )
then
execute immediate 'begin :x := as_passkeys.render( :p1, :p2 ); end;' using out l_rv, p_dynamic_action, p_plugin;
end if;
return l_rv;
end init_plugin_and_render;
function init_table
return boolean
is
e_not_declared exception;
pragma exception_init( e_not_declared, -6550 );
begin
begin
execute immediate 'declare x as_user_passkeys%rowtype; begin null; end;';
exception
when e_not_declared then
apex_debug.warn( 'table as_user_passkeys does not exist' );
execute immediate '
create table as_user_passkeys
( id number generated always as identity constraint as_user_passkeys2_pk primary key
, workspace_id number not null
, app_id number not null
, name varchar2(4000 char) not null
, extra varchar2(4000 char)
, passkeys clob
)
';
apex_debug.trace( 'table as_user_passkeys created' );
execute immediate '
alter table as_user_passkeys
add constraint as_user_passkeys_uk unique( workspace_id, app_id, name )
';
apex_debug.trace( 'unique key for as_user_passkeys created' );
end;
execute immediate 'declare x as_user_passkeys%rowtype; begin null; end;';
apex_debug.info( 'table as_user_passkeys exists' );
return true;
end init_table;
function render
( p_dynamic_action apex_plugin.t_dynamic_action
, p_plugin apex_plugin.t_plugin
)
return apex_plugin.t_dynamic_action_render_result
is
l_result apex_plugin.t_dynamic_action_render_result;
begin
if apex_application.g_debug
then
apex_plugin_util.debug_dynamic_action
( p_plugin => p_plugin
, p_dynamic_action => p_dynamic_action
);
end if;
apex_debug.trace( '%s render: %s', p_plugin.name, p_dynamic_action.attribute_01 );
apex_javascript.add_library( p_name => 'webauthn#MIN#'
, p_directory => p_plugin.file_prefix
, p_version => null
);
l_result.attribute_01 := p_dynamic_action.attribute_01;
l_result.attribute_02 := p_dynamic_action.attribute_02;
l_result.attribute_03 := p_dynamic_action.attribute_03;
l_result.attribute_04 := p_dynamic_action.attribute_04;
l_result.ajax_identifier := apex_plugin.get_ajax_identifier;
l_result.javascript_function := '_webauthn';
return l_result;
end render;



































