DBA Data[Home] [Help]

PACKAGE BODY: APPS.FND_SSO

Source


1 package body fnd_sso as
2 /* $Header: afssob.pls 120.1.12010000.1 2008/07/25 14:33:22 appldev ship $ */
3 
4 ----------------------------------------------------------------------------
5 /*
6 **  authenticate_user
7 */
8 FUNCTION authenticate_user(p_user		in varchar2,
9                            p_password	in varchar2) return pls_integer
10 is	pragma autonomous_transaction;
11 	result		varchar2(1);
12 	p_login_id	number;
13 	p_expired	varchar2(1);
14 
15 begin
16 
17 	-- Validate the username/password combination.  If valid, a session will be created and
18 	-- 'Y' will be returned.  If invalid, 'N' will be returned.
19 	result := fnd_web_sec.validate_login(p_user, p_password, p_login_id, p_expired);
20 	commit;
21 
22  	-- If result != 'Y' then raise the exception EXT_AUTH_FAILURE_EXCEPTION
23 	if (result <> 'Y') then
24 		raise EXT_AUTH_FAILURE_EXCEPTION;
25 
26 	-- If result = 'Y', then check if the password is expired.  If it is, then
27 	-- return EXT_AUTH_PASSWD_EXPIRED
28 	elsif (p_expired = 'Y') then
29 		return EXT_AUTH_PASSWD_EXPIRED;
30 
31 	-- If result = 'Y' and password is not expired, then return EXT_AUTH_SUCCESS
32 	else
33 		return EXT_AUTH_SUCCESS;
34 	end if;
35 
36 exception
37   when EXT_AUTH_FAILURE_EXCEPTION then
38     raise;
39   when others then
40     raise EXT_AUTH_UNKNOWN_EXCEPTION;
41 end;
42 ----------------------------------------------------------------------------
43 /*
44 **  change_passwd
45 */
46 PROCEDURE change_passwd(p_user   in varchar2,
47                         p_oldpwd in varchar2,
48                         p_newpwd in varchar2)
49 is
50   res varchar2(1);
51 begin
52   if (p_user is null) then
53     raise EXT_NOT_SUPPORTED_EXCEPTION;
54   end if;
55 
56   res := fnd_web_sec.change_password(p_user, p_oldpwd, p_newpwd, p_newpwd);
57 
58   if (res <> 'Y') then
59     raise EXT_CHANGE_PASSWORD_EXCEPTION;
60   end if;
61 exception
62   when EXT_NOT_SUPPORTED_EXCEPTION then
63     raise;
64   when EXT_CHANGE_PASSWORD_EXCEPTION then
65     raise;
66   when others then
67     raise EXT_AUTH_UNKNOWN_EXCEPTION;
68 end;
69 ----------------------------------------------------------------------------
70 /*
71 **  get_configuration
72 */
73 PROCEDURE get_configuration(p_config out NOCOPY ext_config)
74 is
75   ourConfig ext_config_rec_type;
76 begin
77   raise EXT_NOT_SUPPORTED_EXCEPTION;
78 
79   -- This looks like our big chance to return a list of parameter
80   -- name/value pairs.  Is there anything we want to pass on?
81   p_config(1) := ourConfig;
82 end;
83 ----------------------------------------------------------------------------
84 /*
85 **  get_authentication_name
86 */
87 FUNCTION get_authentication_name return varchar2
88 is
89 begin
90   return 'Application Object Library';
91 end;
92 ----------------------------------------------------------------------------
93 end fnd_sso;