Custom Authentication in Oracle Apex
Custom Authentication in Oracle Apex
Custom Authentication in Oracle Apex
o7planning
All Tutorials Java Maven Gradle Servlet/Jsp Thymeleaf Spring Struts2 Hibernate Java Web Service JavaFX SWT
Oracle ADF Android Python Swift C# C/C++ Ruby Batch Database Oracle APEX Report Client
1- Introduction
2- Default authentication of APEX
3- SQL Script
4- Declaring Application Items
5- Custom Authentication
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
94
Shares
1- Introduction
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
What is Oracle Application Express?
Installing and configuring Oracle Apex 5.0
Install Oracle REST Data Services (ORDS) for
Oracle APEX
Oracle APEX Tutorial for Beginners (APEX 5.0)
Oracle APEX Tabular Form Tutorial
Oracle APEX Master Details Tutorial
Custom Authentication in Oracle APEX
Oracle APEX Dynamic Action Tutorial
Create Dynamic Content Region in Oracle APEX
(PL/SQL Dynamic Content)
What is Business Intelligence?
Installing and configuring Oracle BI 11g
3- SQL Script
report this ad
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Newest Documents
To begin this example, you need to run Script to create table to store user and create package.
Create USER_ACCOUNT table:
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
13 alter table USER_ACCOUNT
14 add constraint USER_ACCOUNT_UK unique (EMAIL) ;
15
16 -----------------------------------
17
18 insert into user_account (USER_NAME, PASSWORD, USER_TYPE,
19 ACTIVE, EMAIL, FULL_NAME)
20 values ('tom', 'tom123', 'admin', 'Y', 'tom@example.com', 'Tom');
21
22 insert into user_account (USER_NAME, PASSWORD, USER_TYPE,
23 ACTIVE, EMAIL, FULL_NAME)
24 values ('jerry', 'jerry123', 'user', 'Y', 'jerry@example.com', 'Jerry');
25
26 insert into user_account (USER_NAME, PASSWORD, USER_TYPE,
27 ACTIVE, EMAIL, FULL_NAME)
28 values ('donald', 'donald123', 'guest', 'N', 'donald@example.com', 'Donald');
29
30 Commit;
report this ad
PKG_SECURITY
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
26 Return False;
27 End If;
28 ----
29 Begin
30 Select u.Active
31 ,u.Password
32 ,u.Email
33 Into v_Active
34 ,v_Password
35 ,v_Email
36 From User_Account u
37 Where u.User_Name = p_User_Name;
38 Exception
39 When No_Data_Found Then
40
41 -- Write to Session, User not found.
42 Apex_Util.Set_Session_State('LOGIN_MESSAGE'
43 ,'User not found');
44 Return False;
45 End;
46 If v_Password <> p_Password Then
47
48 -- Write to Session, Password incorrect.
49 Apex_Util.Set_Session_State('LOGIN_MESSAGE'
50 ,'Password incorrect');
51 Return False;
52 End If;
53 If v_Active <> 'Y' Then
54 Apex_Util.Set_Session_State('LOGIN_MESSAGE'
55 ,'User locked, please contact admin');
56 Return False;
57 End If;
58 ---
59 -- Write user information to Session.
60 --
61 Apex_Util.Set_Session_State('SESSION_USER_NAME'
62 ,p_User_Name);
63 Apex_Util.Set_Session_State('SESSION_EMAIL'
64 ,v_Email);
65 ---
66 ---
67 Return True;
68 End;
69
70 --------------------------------------
71 Procedure Process_Login(p_User_Name Varchar2
72 ,p_Password Varchar2
73 ,p_App_Id Number) As
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
74 v_Result Boolean := False;
75 Begin
76 v_Result := Authenticate_User(p_User_Name
77 ,p_Password);
78 If v_Result = True Then
79 -- Redirect to Page 1 (Home Page).
80 Wwv_Flow_Custom_Auth_Std.Post_Login(p_User_Name -- p_User_Name
81 ,p_Password -- p_Password
82 ,v('APP_SESSION') -- p_Session_Id
83 ,p_App_Id || ':1' -- p_Flow_page
84 );
85 Else
86 -- Login Failure, redirect to page 101 (Login Page).
87 Owa_Util.Redirect_Url('f?p=&APP_ID.:101:&SESSION.');
88 End If;
89 End;
90
91 End Pkg_Security;
92 /
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Enter a name for the Application Item is "LOG_MESSAGE", its value is "LOGIN_MESSAGE" attribute of
Session, you can set its value in PL/SQL:
1 Apex_Util.Set_Session_State('LOGIN_MESSAGE' ?
2 ,'User not found');
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Similarly, you create 2 Application Items:
SESSION_USER_NAME
SESSION_EMAIL
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
5- Custom Authentication
Open LOGIN page in APEX Page Designer:
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create new Region:
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Change the properties for the newly created Region.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Set display conditions for this Region.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Next you have to modify code handling Process when the user clicks the Submit button.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
PL/SQL Code:
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
1 Pkg_Security.Process_Login(:P101_USERNAME, ?
2 :P101_PASSWORD,
3 :APP_ID);
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
View more Tutorials:
o7planning.org
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD