HomeОбразованиеRelated VideosMore From: Boby Siswanto

Oracle APEX 5 Custom Authentication

63 ratings | 18111 views
website article can be found here: http://www.developapex.com/2018/04/custom-authentication-scheme-on-oracle.html and here: http://www.developapex.com/2018/04/custom-authentication-on-oracle-apex.html Berikut langkah-langkah membuat custom authentication pada Oracle APEX 5: Custom Authentication pada Oracle APEX 5.0 1. Gunakan Object Browser untuk membuat tabel dengan nama TLOGIN 2. Buat sebuah database application, misal namanya myauth dengan id 123 3. Selesai pembuatan database application, klik Shred Component 4. Pada area Security klik Authentication Schemes 5. Klik tombol Create, beri nama otentikasiku, pada pilihan Schema Type pilih Custom 6. Pada bagian Source isikan kode PL/SQL berikut: FUNCTION cek_otentikasi (p_username IN VARCHAR2, p_password IN VARCHAR2) RETURN BOOLEAN AS hasil NUMBER := 0; BEGIN SELECT 1 INTO hasil FROM tlogin WHERE UPPER(username) = UPPER(p_username) AND password = p_password AND status= :P101_STATUS AND ket= 'AKTIF'; RETURN TRUE; EXCEPTION WHEN NO_DATA_FOUND THEN RETURN FALSE; END cek_otentikasi; 7. Pada bagian Settings, pada isian Authentication Function Name, isikan cek_otentikasi (sesuaikan dengan nama function) lalu klik tombol Create 8. Kembali ke Page Definition, klik tombol Edit Application Properties (kanan atas) lalu klik tab Security 9. Pada sub tab Authentication, pada isian Authentication Scheme pilih otentikasiku lalu klik Aply Changes 10. Run (Jalankan) aplikasi myauth, coba login dengan menggunakan username dan password yang ada di tabel TLOGIN. Silahkan Subscribe
Html code for embedding videos on your blog
Text Comments (44)
Hashim Mahmood (4 months ago)
i have an error at the time of login (wrong number of arguments).i just want to know .how can i fix it.Thanks
Hashim Mahmood (4 months ago)
Yes it Works.Thanks a lot brother.
Boby Siswanto (4 months ago)
Did You create status item as 5:40?if yes please modify the script as 4:41. Inform me If that doesn't works. Regards, Boby
Hashim Mahmood (4 months ago)
FUNCTION USER_LOGIN(U VARCHAR2,P VARCHAR2) RETURN BOOLEAN AS STATUS varchar2(30); BEGIN SELECT 1 INTO STATUS FROM USERS WHERE UPPER(USERNAME)=UPPER(U) AND UPPER(PASSWORD)=UPPER(P); RETURN TRUE; EXCEPTION WHEN NO_DATA_FOUND THEN RETURN FALSE; END;
Boby Siswanto (4 months ago)
Could You please send your PL/SQL Authentication Script?
Lawrence Stowe (1 year ago)
I’m getting an error ORA-06550 indentifier ‘userauthschemelogin must be declared
Boby Siswanto (1 year ago)
could you please send your custom authentication scripts?
Mohamad Suliman (1 year ago)
Thanks
Boby Siswanto (1 year ago)
You're Welcome
basuki rahmat (1 year ago)
Nice tutorial..salam dari penggemar APEX
basuki rahmat (1 year ago)
mohon bisa reply via email mas boby ke [email protected]
basuki rahmat (1 year ago)
ada mas luthfi hedir juga pakar di bonexapex.blogspot.com , saya sangat senang bertemu para pakar apex
Boby Siswanto (1 year ago)
Salam balik mas Basuki, Senang mengetahui ada yang menggemari APEX juga :)
Kabuhulan Team (1 year ago)
Bagaimana caranya di oracle apex 5 ini, untuk mendapatkan session user_id atau usernamenya?
Kabuhulan Team (1 year ago)
terima kasih pak atas jawabannya. :)
Boby Siswanto (1 year ago)
gunakan &APP_USER. atau :APP_USER silahkan lihat videonya disini https://youtu.be/1nvPCkk1zgA
Kabuhulan Team (1 year ago)
Hallo pak Bobby, saya tertarik belajar oracle apex ini. Apakah saya harus mulai dari belajar dasar dari oracle sendiri, seperti sql, pl/sql ? apakah anda punya rekomendasi saya harus belajar mulai darimana? Terima kasih
Boby Siswanto (1 year ago)
Domisili saya di Bandung. Kebetulan saya mengajar di sebuah universitas di Bandung, tapi untuk mengadakan pelatihan Oracle saya belum pernah memberikannya.
Kabuhulan Team (1 year ago)
terima kasih atas jawabannya pak? maaf kalo boleh tahu bapak berasala dari mana? Apakah bapak mengadakan pelatihan untuk oracle ?
Boby Siswanto (1 year ago)
Hallo juga, Oracle APEX sebenarnya merepresentasikan SQL dan PL/SQL menjadi sebuah aplikasi web/mobile. Dengan SQL dan PL/SQL sebenarnya sudah cukup membuat sebuah aplikasi, tapi jika aplikasi yang di buat ingin lebih "hidup" bisa ditambahkan CSS+Javascript atau bahkan jquery. Sampai saat ini saya belum menemukan tutorial Bahasa Indonesia yang khusus membahas Oracle APEX, tapi kalau buku bahasa Inggris ada. Untuk memulai Anda bisa mempelajari dari: https://www.w3schools.com/SQL/deFault.asp http://plsqlsample.blogspot.co.id/ https://www.tutorialspoint.com/plsql/ http://www.oracle.com/technetwork/developer-tools/apex/application-express/apex-getting-started-1863613.html Sebenarnya saya sedang menyusun buku tentang dasar Oracle APEX sendiri dalam Bahasa Indonesia. Oke selamat menimba ilmu, semoga baknya segera terisi ilmu yang bermanfaat :)
Kaz Tee (1 year ago)
Hi can you tell me how I can get my login page to work if I have signup page. I tried everything I can't get it to work. Can you create a tutorial how to get my pages to work
gyana ranjan (2 years ago)
Hi , I have apex URL integrated within my application. URL like : https://slms.ABCDEF.com/apex/f?p=107:3:::::P_USER:c2FyZ2JlaGU= Here from the other application we are passing :P_USER which is the user name of the current user . I want to use that :P_USER variable value in my apex report for user authentication and other query operations . Please guide me how i can use the :P_USER value passed from the URL in APEX authentications . Issues I am facing ------------------- 1. I can't able to use the :P_USER variable value in APEX to authenticate the user so the report is open for all now .(For now i am using apex authentication for temporary). 2. If somebody copy the URL and paste in other browser then the APEX report UI opens with out any security . How to prevent the copy paste URL working for customer ? 3. What are the other security method i can apply in the APEX by using the variable passed in URL ? :P_USER . 4. How i can achieve the SSO (Single sign on) APEX . We have integrated the APEX URL in other application and we have a requirement to implement the SSO . But i am new to apex and i have no idea how to implement . Could you please guide me on solving these issues . Please send some steps how to do that in my email: [email protected] . Thank you in advance . Regards Gyana
Boby Siswanto (1 year ago)
You may to create hidden item on every page with same name (P_USER), you can use the P_USER item value on your PL/SQL. Alternatively you can utilizing the global page by using application item, you might to watch my video here https://www.youtube.com/watch?v=7wQ1G0njmxw Regards
gyana ranjan (1 year ago)
So where i have to create the item ? My application has 23 pages and 1 global page . So where i hace to create a hidden item and where to set ? Is it necessary to create in the same name ? Please guide me where i will have to create and what setting i have to do .
Boby Siswanto (1 year ago)
yes there is a difference between APP_USER and your P_USER, sorry little bit misunderstood. To catch the P_USER you can add hidden item or textfield item and set the name as P_USER
gyana ranjan (1 year ago)
Boby Siswanto could you please let me know what kind of condition we can put in report to restrict the copy paste URL access which is point 2 . Any example will be very helpful brother .
gyana ranjan (1 year ago)
Boby Siswanto hi boby, I am getting the p_user variable from URL then how I will assign that value to APP_USER?? See if user ABCD clicked the URL then from UI we are passing ABCD as :p_user . So In Apex report how I can catch that user name ABCD to authenticate ????
Guilherme Sa (2 years ago)
Hey, thank you for this! On min 0:33 what does 'ket' mean for one of the fields in tlogin table?
Boby Siswanto (2 years ago)
Hi Guilherme, ket field on tlogin tabel is used for holding the status of existing user, whether the user is active or not. the values of ket field should be the same as on min 4:47 (line 10) regards
Masuma Shah (2 years ago)
Salam, How do I get from the login page on the registration page. And from the login page to the respective home page ??? I would appreciate an answer
Boby Siswanto (2 years ago)
Salam Masuma, I have a tutorial for redirecting user role to specific home page, but sorry i wrote it in Indonesian and the video has no sound. http://cisku.com/archives/200 may be that will help You, regards
THANKS YOU FOR THIS VIDEO !! IS EXCELENT
JAJAJAJAJA
Boby Siswanto (2 years ago)
You're Welcome...
yuri astoria (2 years ago)
alhamdulilah ada tutor APEX5 .....sukses dan sehat selalu om.... btw boleh tanya ndak untuk design page sendiri agar posisi column2 dan item2nya bisa rapih gimana y om ? kalo saya lhat kan apex menggunakan Grid dan bermain di column dan spans-nya...terkadang saya membuat Text dengan DISPLAY ONLY pada row 1 dan row 2 tidak bisa sama2 rata kanan.... dan itu berlaku pada item2 lainnya juga...padahal column dan spansnya sudah diatur. thank u omm ilmunya,,,
Boby Siswanto (2 years ago)
mungkin bisa coba beralih ke componen view (4 icon kotak di atas), pada masing-masing region atur grid layout (column attributes bisa menampung inline css)
Aravind Rajasekaran (2 years ago)
Could you please share your number will call and get it done.
Aravind Rajasekaran (2 years ago)
Hi Boby, Even I tried that too.Could you please help me out on team viewer At what time you are available.
Boby Siswanto (2 years ago)
Please create one administrator user account on your workspace and send to [email protected] along with your apex server public ip address
Aravind Rajasekaran (2 years ago)
This is the query created.Its showing error.Please help me out Function mp_apex1(p_username IN VARCHAR2,p_passwordIN VARCHAR2) RETURN BOOLEAN AS APEX1 NEMBER:=0; BEGIN SELECT 1 INTO APEX FROMLOGIN WHERE UPPER(username)=UPPER(p_username) AND password=p_password AND ststus=:p101_Status AND mp='APEX1'; RETURN TRUE; EXCEPTION WHENNO_DATA_FOUND_THEN RETURN FALSE; END MP_APEX1; -------------------------------------------------------------------- declare apex1 varchar2(8); begin select status into apex1 from login where upper(username)=upper(:app_user); if nvl(apex1,'x')='apex' then return true; end if; reutrn false; end;
Boby Siswanto (2 years ago)
+Aravind Rajasekaran Hi Aravind, could you please show me the error messages? you write some wrong typo on your code perhaps that the cause the authentication function will catch 3 items value from login page (P101_USERNAME, P101_PASSWORD, P101_STATUS) that will be compared with login table fields(username, password, status). Initially status variable will be assign with 0, if the comparisons is returning true then state of the function will become true and login will be successful, otherwise login fill failed. select status into apex1 from login where upper(username)=upper(:app_user); -> will check the status value on authenticated user on login table and fill the apex1 variable with the value. if nvl(apex1,'x')='apex' then return true; -> if the apex1 variable contains 'apex' value the the authorization state will true and the page will be able to accessed. i hope that explanations is clear enough
Aravind Rajasekaran (2 years ago)
we need to create any authorization before authentication
Aravind Rajasekaran (2 years ago)
could you please explain me in english ,Its very usefull.

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.