ITPUB??ì3
ITPUB论坛 » Oracle开发 » Can not get client user name in mod_plsql

标题: [未解决] [PL/SQL] Can not get client user name in mod_plsql
  [未解决] 本主题悬赏 pub币 1  
离线 f2xie
初级会员



精华贴数 0
个人空间 0
技术积分 22 (49933)
社区积分 0 (463437)
注册日期 2005-6-15
论坛徽章:1
2008年新春纪念徽章     
      

发表于 2008-6-28 14:20 
Can not get client user name in mod_plsql

Question:
In a web application, we want to obtain the client user name. For example, a user with
user name "tomid" to log in to his window machine and open a browser to access the
web application, how can we obtain the "tomid" in the web application?
Environmnet: using mod_plsql in OAS10g, the application is written by package/procedure in pl/sql.
The method I have tried:
1) using owa_util.get_cgi_env('REMOTE_USER'), this one alway return the schema name but not the client name.
2) using sys_context and return empty everytime.
3) If we add a line: PlsqlCGIEnvironmentList REMOTE_USER=testuser in DAD string, the function owa_util.get_cig_env('REMOTE_USER') will return 'testuser'
Any idea how to obtain the user name in the package/procedure; or how to set the oracle
web server so that owa_util.get_cgi_env('REMOTE_USER") can return the user name.
Thank you so much!


只看该作者    顶部
离线 atgc
高级会员


精华贴数 1
个人空间 0
技术积分 7947 (155)
社区积分 168 (2534)
注册日期 2004-7-22
论坛徽章:34
2008北京奥运纪念徽章:射箭2008北京奥运纪念徽章:蹦床2008北京奥运纪念徽章:跳水2008北京奥运纪念徽章:举重2008北京奥运纪念徽章:排球2008北京奥运纪念徽章:花样游泳
2008北京奥运纪念徽章:垒球2008北京奥运纪念徽章:手球2008北京奥运纪念徽章:帆船2008北京奥运纪念徽章:羽毛球生肖徽章2007版:鼠生肖徽章:鸡

发表于 2008-6-28 18:50 
SELECT SYS_CONTEXT('USERENV','OS_USER') FROM DUAL;


__________________
只看该作者    顶部
在线/呼叫 junsansi
无名扫把


来自 bj
精华贴数 7
个人空间 8669
技术积分 7691 (164)
社区积分 585 (1255)
注册日期 2006-7-17
论坛徽章:59
现任管理团队成员2008北京奥运纪念徽章:皮划艇静水2008北京奥运纪念徽章:跳水2008北京奥运纪念徽章:拳击2008北京奥运纪念徽章:游泳2008北京奥运纪念徽章:垒球
      

发表于 2008-6-28 20:12 
查看v$session试试


__________________
[三思笔记]学习动态性能表
[三思笔记]一步一步学rman
[三思笔记]oracle著名及非著名函数介绍
[三思笔记]Statspack初步学和用
[三思笔记]RMAN高级应用之Duplicate复制数据库
[三思笔记]使用传输表空间的特性复制数据
[三思笔记]一步一步学DataGuard
[三思笔记]全面学习分区表及分区索引
[三思笔记]手把手教你用VMware安装Oracle10g RAC
[三思笔记]全面学习oracle flashback特性

沉淀是一件很枯燥的事情,我要从沉淀中汲取营养,于枯燥中寻找乐趣,我没疯,你才是疯子,哇哈哈,哇哈哈哈哈~~
============================================
http://www.5ienet.com我爱我佳
扫地不过是我表面上的工作,我真正的身份其实是无名老僧------------------手里那根扫把~~~~
只看该作者    顶部
离线 f2xie
初级会员



精华贴数 0
个人空间 0
技术积分 22 (49933)
社区积分 0 (463437)
注册日期 2005-6-15
论坛徽章:1
2008年新春纪念徽章     
      

发表于 2008-6-28 22:25 
回复 #2 atgc 的帖子

Thanks atgc.
But it returns nothing. I guess it makes sense because sys_context does not run in the same space as the package.  
I think the OWS security setting prevent the owa_util.get_cig_env('REMOTE_USER') from obtaining the right client user name. We are using OAS basic authentication in the DAD string. But I do not know how to make it work.
Somebody has the similar experience before? Thanks. (My apology not using Chinese here due to the lack of chinese input
in my computer, sorry again)


只看该作者    顶部
离线 f2xie
初级会员



精华贴数 0
个人空间 0
技术积分 22 (49933)
社区积分 0 (463437)
注册日期 2005-6-15
论坛徽章:1
2008年新春纪念徽章     
      

发表于 2008-6-28 22:26 
回复 #3 junsansi 的帖子

Thanks junsansi
I don't think v$session can give the right answer.


只看该作者    顶部
离线 f2xie
初级会员



精华贴数 0
个人空间 0
技术积分 22 (49933)
社区积分 0 (463437)
注册日期 2005-6-15
论坛徽章:1
2008年新春纪念徽章     
      

发表于 2008-7-1 03:38 
回复 #4 f2xie 的帖子

It looks that basic authentication mode in mod_plsql without requiring end user to log in makes the REMOTE_USER point to the wrong
os_user (it points to database user set in DAD string); However, if I set the authentication mode to others such as global owa or custom owa, it will require the end user to log in with user name and password.  
At present, my question is: how to set up the authentication mode in mod_plsql so that the package/procedure can get the OS_USER name
while the end user does not need to log in to the web page ( it means no log in dialog box poped out when the user open the web page)
Anyone interested in the topic, we can go on discussing. Thanks.

Here is what I read from Metalink:

From: Anton Els 18-Dec-02 09:41
Subject: Re : How to get OS Username from Web Page via PLSQL WEB Toolkit


I am still sitting with the same problem. I want to use BASIC Authentication not having User login screens etc. I would like the user to connect to the application without entering any userid or passwords, and then let the application lookup the user in a user table to get the specific application authorizatoin needed by the user, which will then allow certain options to the user in the WEB app. This user section will be maintained by a different application.

But, if the user login via the WEB to the Application, the OS USER name is the "NT AUTHORITYSYSTEM" user, which is not what I am looking for (I think it picks up the userid that apache is running under) , I need the actual OS USERID of that specific user. I have looked at the sys_context options but it only brings back the same info or the Database user id. Is there any other way of doing this without making use of a actual login screen where the user need to type in a userid and password? Is there any html, or javascript options I can use to get this userid?





--------------------------------------------------------------------------------

From: Oracle, Ken Vincent 26-Dec-02 17:50
Subject: Re : Re : How to get OS Username from Web Page via PLSQL WEB Toolkit


Anton,

There isn't a way within the PL/SQL Tookit. There used to be a nt authentication feature in the older webserver versions, but it was not very reliable, as different circumstances beyond anyone's control can block the info from being obtained.

In order to use REMOTE_USER, you still need to have some sort of authentication occur within the HTTP Server in order for the PL/SQL Tookit to use it.




Ken Vincent
Internet Products Support


只看该作者    顶部
离线 f2xie
初级会员



精华贴数 0
个人空间 0
技术积分 22 (49933)
社区积分 0 (463437)
注册日期 2005-6-15
论坛徽章:1
2008年新春纪念徽章     
      

发表于 2008-7-3 09:19 
回复 #6 f2xie 的帖子

Ok, the problem can be solved by WNA (windows Native Authentication) together with SSO (single sign on).
Here is the link useful for those who might have the same problem:
http://download-uk.oracle.com/do ... b13791/kerberos.htm


只看该作者    顶部
 
    

相关内容


CopyRight 1999-2006 itpub.net All Right Reserved.
北京皓辰广域网络信息技术有限公司. 版权所有
E-mail:Webmaster@itpub.net
京ICP证:010037号 联系我们 法律顾问