- 最后登录
- 2018-11-1
- 在线时间
- 377 小时
- 威望
- 29
- 金钱
- 6866
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 891
- 精华
- 4
- 积分
- 29
- UID
- 1
|
2#
发表于 2012-12-7 21:26:04
Proxy authentication is the fifth method that can be used in Oracle databases to help deal with some of the potential issues around middle tier connections.
Oracle Proxy Authentication Options
If the user is either a database user or an enterprise user (maintained via Oracle Internet Directory with a distinguished name) then Oracle offers a solution based on the fact that the end user is actually known to the database. In either of these cases, a pass-through approach or re-authentication approach can be used.
Oracle also has a proxy method that can be used for situations where the end user is known only to the application and not directly to the database. This method is known as an application user model. In this case, the user is tracked via an assigned identifier and the activities can be audited using that identifier rather than end user information.
我的理解 在三层应用中 ,通过proxy user可以实现 只有应用程序识别用户 而不让database直接关联用户。- SQL> create user proxy_user
- 2 identified by pw_proxy
- 3 default tablespace users
- 4 temporary tablespace temp;
- User created.
- SQL> create user target_user
- 2 identified by pw_target
- 3 default tablespace users
- 4 temporary tablespace temp
- 5 quota unlimited on users;
- User created.
- SQL> alter user target_user grant connect through proxy_user;
- User altered.
- SQL> grant create session,
- 2 create table
- 3 to target_user;
- Grant succeeded.
- SQL> connect target_user/pw_target
- Connected.
- select instance_name from v$instance
- *
- ERROR at line 1:
- ORA-00942: table or view does not exist
- SQL> create table targets_table (
- 2 col varchar2(10)
- 3 );
- Table created.
- SQL> insert into targets_table values ('foo');
- 1 row created.
- SQL> commit;
- Commit complete.
- SQL> connect proxy_user[target_user]/pw_proxy
- Connected.
- select instance_name from v$instance
- *
- ERROR at line 1:
- ORA-00942: table or view does not exist
- SQL> select * from targets_table;
- COL
- ----------
- foo
- SQL> conn proxy_user/pw_proxy
- ERROR:
- ORA-01045: user PROXY_USER lacks CREATE SESSION privilege; logon denied
- Warning: You are no longer connected to ORACLE.
- SQL> conn / as sysdba
- Connected.
- INSTANCE_NAME
- ----------------
- VRAC1
- SQL> grant dba to proxy_user;
- Grant succeeded.
- SQL> conn proxy_user/pw_proxy
- \Connected.
- INSTANCE_NAME
- ----------------
- VRAC1
- SQL> \
- SQL> SQL> SQL> SQL> SQL>
- SQL>
- SQL>
- SQL> select * from tab;
- no rows selected
复制代码 |
|