you might need it for user migration.
1> create a function
create or replace function xxta_get (key in varchar2, value in varchar2)
return varchar2
as
language java
name 'oracle.apps.fnd.security.WebSessionManagerProc.decrypt(java.lang.String,java.lang.String) return java.lang.String'
;
/
2> use
>> 2.1 when you know the apps password
select xxta_get(<apps password in capital>,encrypted_user_password)
from fnd_user
where user_name = 'XXUSER' ;
>> 2.2 when you do not know the apps password
select usr.user_name,
xxta_get
((select (select xxta_get
(fnd_web_sec.get_guest_username_pwd,
usertable.encrypted_foundation_password
)
from dual) as apps_password
from fnd_user usertable
where usertable.user_name =
(select substr
(fnd_web_sec.get_guest_username_pwd,
1,
instr
(fnd_web_sec.get_guest_username_pwd,
'/'
)
- 1
)
from dual)),
usr.encrypted_user_password
) password
from fnd_user usr
where usr.user_name = :user_name
OR
1> create below packaged procedure
>> package specification
create or replace package xxta_get
as
function ini_decrypt (key in varchar2, value in varchar2)
return varchar2;
function decrypt (p_user_name in varchar2)
return varchar2;
end xxta_get;
/
>> package body
create or replace package body xxta_get
as
function ini_decrypt (key in varchar2, value in varchar2)
return varchar2
as
language java
name 'oracle.apps.fnd.security.WebSessionManagerProc.decrypt(java.lang.String,java.lang.String) return java.lang.String';
function decrypt (p_user_name in varchar2)
return varchar2
as
l_pwd varchar2(40);
begin
select --usr.user_name,
ini_decrypt
((select (select ini_decrypt
(fnd_web_sec.get_guest_username_pwd,
usertable.encrypted_foundation_password
)
from dual) as apps_password
from fnd_user usertable
where usertable.user_name =
(select substr
(fnd_web_sec.get_guest_username_pwd,
1,
instr
(fnd_web_sec.get_guest_username_pwd,
'/'
)
- 1
)
from dual)),
usr.encrypted_user_password
) password
into l_pwd
from fnd_user usr
where usr.user_name = p_user_name;
return l_pwd;
end;
end xxta_get;
/
use
select xxta_get.decrypt('XXUSER')
from dual;
--
1> create a function
create or replace function xxta_get (key in varchar2, value in varchar2)
return varchar2
as
language java
name 'oracle.apps.fnd.security.WebSessionManagerProc.decrypt(java.lang.String,java.lang.String) return java.lang.String'
;
/
2> use
>> 2.1 when you know the apps password
select xxta_get(<apps password in capital>,encrypted_user_password)
from fnd_user
where user_name = 'XXUSER' ;
>> 2.2 when you do not know the apps password
select usr.user_name,
xxta_get
((select (select xxta_get
(fnd_web_sec.get_guest_username_pwd,
usertable.encrypted_foundation_password
)
from dual) as apps_password
from fnd_user usertable
where usertable.user_name =
(select substr
(fnd_web_sec.get_guest_username_pwd,
1,
instr
(fnd_web_sec.get_guest_username_pwd,
'/'
)
- 1
)
from dual)),
usr.encrypted_user_password
) password
from fnd_user usr
where usr.user_name = :user_name
OR
1> create below packaged procedure
>> package specification
create or replace package xxta_get
as
function ini_decrypt (key in varchar2, value in varchar2)
return varchar2;
function decrypt (p_user_name in varchar2)
return varchar2;
end xxta_get;
/
>> package body
create or replace package body xxta_get
as
function ini_decrypt (key in varchar2, value in varchar2)
return varchar2
as
language java
name 'oracle.apps.fnd.security.WebSessionManagerProc.decrypt(java.lang.String,java.lang.String) return java.lang.String';
function decrypt (p_user_name in varchar2)
return varchar2
as
l_pwd varchar2(40);
begin
select --usr.user_name,
ini_decrypt
((select (select ini_decrypt
(fnd_web_sec.get_guest_username_pwd,
usertable.encrypted_foundation_password
)
from dual) as apps_password
from fnd_user usertable
where usertable.user_name =
(select substr
(fnd_web_sec.get_guest_username_pwd,
1,
instr
(fnd_web_sec.get_guest_username_pwd,
'/'
)
- 1
)
from dual)),
usr.encrypted_user_password
) password
into l_pwd
from fnd_user usr
where usr.user_name = p_user_name;
return l_pwd;
end;
end xxta_get;
/
use
select xxta_get.decrypt('XXUSER')
from dual;
--
Can we use in Production?
ReplyDeleteDear Anonymous,
ReplyDeleteIf you have access and required permission, you can use anywhere mate.