authentication required

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jdorlon
Posts: 202
Joined: Fri 05 Jan 2007 22:07

authentication required

Post by jdorlon » Thu 03 Nov 2016 20:08

Hello,

I know that with ODAC I can connect proxy users that are set up like this:

ALTER USER xxxxxxx GRANT CONNECT THROUGH yyyyyy;

What about if they are set up like this?

ALTER USER xxxxxxx GRANT CONNECT THROUGH yyyyyyy AUTHENTICATION REQUIRED;

Thanks,
John Dorlon

jdorlon
Posts: 202
Joined: Fri 05 Jan 2007 22:07

Re: authentication required

Post by jdorlon » Fri 04 Nov 2016 16:40

OK, I have found that I can make it work. FYI - here are the users that I am creating:

Code: Select all

   create user app_user identified by app_user;
   create user end_user identified by end_user;
   create user end_user_ar identified by end_user_ar;
   grant create session to app_user;
   grant create session to end_user;
   grant create session to end_user_ar;
   alter user end_user grant connect through app_user;
   alter user end_user_ar grant connect through app_user authentication required;
now, after running that script, and using two TOraSessions, I can do this:

Code: Select all

  proxy_session.Username := 'app_user';
  proxy_session.password := 'app_user';
  proxy_session.server := 'ORCL12CR2_PLUG';
  session.Username := 'end_user_ar';
  session.password := 'end_user_ar';
  session.server := 'ORCL12CR2_PLUG';
  proxy_session.Connected := True;
  Session.ProxySession := proxy_session;
  session.Connected := true;
...and that connects just fine.

I have noticed, however that I need to be sure to disconnect SESSION before I disconnect PROXY_SESSION, otherwise, there is an OCI_INVALID_HANDLE error.

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: authentication required

Post by MaximG » Mon 07 Nov 2016 13:08

This ODAC behavior is correct. Before closing a Proxy-session, you should make sure that all connections, opened with this user by this moment are closed. This behavior is implemented in ODAC Demo : [ODAC install folder]\Demos\OdacDemo\ProxySession .

Post Reply