ODAC Authentication
ODAC Authentication
We have purchase the ODAC component over 2 months ago and it performs very well with Oracle 10g using the NET option, Thank You !
However, now we would like to add an Active Directory authentication to our Delphi+ODAC application (or any other native Windows authentication) so the application user, is not forced to login twice (once to the Windows workstation and second to the Oracle server in Delphi application) and in order to centralize our user management.
We are on a MS-Server 2003 domain and have Active Directory enabled.
Is there a way we could accomplish Windows external/native authentication with ODAC in NET mode.
If not, why not, and could you elaborate what would be needed to authenticate to Oracle as a Windows domain user ?
Thank you in advance,
Horace
However, now we would like to add an Active Directory authentication to our Delphi+ODAC application (or any other native Windows authentication) so the application user, is not forced to login twice (once to the Windows workstation and second to the Oracle server in Delphi application) and in order to centralize our user management.
We are on a MS-Server 2003 domain and have Active Directory enabled.
Is there a way we could accomplish Windows external/native authentication with ODAC in NET mode.
If not, why not, and could you elaborate what would be needed to authenticate to Oracle as a Windows domain user ?
Thank you in advance,
Horace
Last edited by Horace on Fri 15 Feb 2008 17:18, edited 1 time in total.
Hi,
I have a problem by setting the options.net:=true in my program...
Can you send me a piece of code, how you're are setting this option?
When I set the option of True in my procedure, I've the exception: "Features is not supported".
(I'm using BDS2006, Oracle 10g and latest ODAC.)
Thank you in advance,
oweis
I have a problem by setting the options.net:=true in my program...
Can you send me a piece of code, how you're are setting this option?
When I set the option of True in my procedure, I've the exception: "Features is not supported".
(I'm using BDS2006, Oracle 10g and latest ODAC.)
Thank you in advance,
oweis
The following piece of code sets the NET option programmatcaly in. This code is verified to work in Delphi 6.
You should be disconnected before trying to change the NET option.
Regards,
Horace
You should be disconnected before trying to change the NET option.
Regards,
Horace
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
begin
OraSession1.Options.Net:=TRUE;
OraSession1.Connect;
OraTable1.Active:=TRUE;
end;-
Challenger
- Devart Team
- Posts: 925
- Joined: Thu 17 Nov 2005 10:53
-
Challenger
- Devart Team
- Posts: 925
- Joined: Thu 17 Nov 2005 10:53
-
Challenger
- Devart Team
- Posts: 925
- Joined: Thu 17 Nov 2005 10:53
We don't want to use the OCI mode because the we'd have to install the bloated Oracle client on every workstation. The whole idea of ODAC was to distribute our client application without the Oracle bloatware as one elegant skinny exec.
Users couldn't install the Oracle bloatware themselves, anyway...
If you will not add authentication to ODAC then we will have to do it ourselves.
Do we have the right to modify your ODAC source code?
Can you save me some time and at least point me in the right direction what would be needed to add Windows authentication to ODAC.
One of your developers must have thought about it already, maybe he'd be willing to share his plan of action.
I am an experienced Win API programmer (UM & KM), but little experience in Oracle protocols.
Regards,
Horace
Users couldn't install the Oracle bloatware themselves, anyway...
If you will not add authentication to ODAC then we will have to do it ourselves.
Do we have the right to modify your ODAC source code?
Can you save me some time and at least point me in the right direction what would be needed to add Windows authentication to ODAC.
One of your developers must have thought about it already, maybe he'd be willing to share his plan of action.
I am an experienced Win API programmer (UM & KM), but little experience in Oracle protocols.
Regards,
Horace
-
Challenger
- Devart Team
- Posts: 925
- Joined: Thu 17 Nov 2005 10:53
Authenticating on WinXP
I solved this problem easily.
On WinXP/200x, you can ask SO if you are authenticated on a domain. If you know you are authenticated, you can assume that what user is logged.
type
PTokenUser = ^TTokenUser;
_TOKEN_USER = record
User: TSIDAndAttributes;
end;
TTokenUser = _TOKEN_USER;
procedure UserDomainName(var User, Domain: String);
var hProcess, hAccessToken: THandle;
InfoBuffer: array[0..1000] of Char;
szAccountName, szDomainName: array [0..200] of Char;
dwInfoBufferSize, dwAccountSize, dwDomainSize: DWORD;
pUser: PTokenUser;
snu: SID_NAME_USE;
begin
dwAccountSize:=200;
dwDomainSize:=200;
hProcess:=GetCurrentProcess;
OpenProcessToken(hProcess,TOKEN_READ,hAccessToken);
GetTokenInformation(hAccessToken,TokenUser,@InfoBuffer[0],1000,
dwInfoBufferSize);
pUser:=PTokenUser(@InfoBuffer[0]);
LookupAccountSid(nil, pUser.User.Sid, szAccountName, dwAccountSize, szDomainName, dwDomainSize, snu);
User:=szAccountName;
Domain:=szDomainName;
CloseHandle(hAccessToken);
end;
Good Luck,
Josir
On WinXP/200x, you can ask SO if you are authenticated on a domain. If you know you are authenticated, you can assume that what user is logged.
type
PTokenUser = ^TTokenUser;
_TOKEN_USER = record
User: TSIDAndAttributes;
end;
TTokenUser = _TOKEN_USER;
procedure UserDomainName(var User, Domain: String);
var hProcess, hAccessToken: THandle;
InfoBuffer: array[0..1000] of Char;
szAccountName, szDomainName: array [0..200] of Char;
dwInfoBufferSize, dwAccountSize, dwDomainSize: DWORD;
pUser: PTokenUser;
snu: SID_NAME_USE;
begin
dwAccountSize:=200;
dwDomainSize:=200;
hProcess:=GetCurrentProcess;
OpenProcessToken(hProcess,TOKEN_READ,hAccessToken);
GetTokenInformation(hAccessToken,TokenUser,@InfoBuffer[0],1000,
dwInfoBufferSize);
pUser:=PTokenUser(@InfoBuffer[0]);
LookupAccountSid(nil, pUser.User.Sid, szAccountName, dwAccountSize, szDomainName, dwDomainSize, snu);
User:=szAccountName;
Domain:=szDomainName;
CloseHandle(hAccessToken);
end;
Good Luck,
Josir
-
Challenger
- Devart Team
- Posts: 925
- Joined: Thu 17 Nov 2005 10:53
OS Authentication - my mistake
Hi Challenger,
my mistake: I forgot to say that I use a single Oracle user to connect to all network users and I don't need to connect to Oracle with every single user.
The idea is:
if I can get the Domain Name, I am authenticated.
If I am authenticated, I don't need to ask for username/password.
Just an idea to the guy that want to use Net ODAC option (which is much faster and reliable than Oracle Client version).
Josir.
my mistake: I forgot to say that I use a single Oracle user to connect to all network users and I don't need to connect to Oracle with every single user.
The idea is:
if I can get the Domain Name, I am authenticated.
If I am authenticated, I don't need to ask for username/password.
Just an idea to the guy that want to use Net ODAC option (which is much faster and reliable than Oracle Client version).
Josir.
-
Challenger
- Devart Team
- Posts: 925
- Joined: Thu 17 Nov 2005 10:53