Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to pass environment Userid into Forms? (6i could do it ...)

SM_WorkJul 7 2014 — edited Sep 23 2014

So we're _finally_ working toward migrating from good ol' Forms 6i to Forms 11g. We've worked thru various issues.

The current issue ... how to grab the OS's user ID and pass it into the form?

I know this may be a redundant question: but I searched and could not find an answer.

The original way was ...

[path][ifrun60.EXE [path2\form-to-call %username%/[pswd]@db_name

But now ... every example I can easily find shows "userID" in the formsweb.cfg file as a whole, hard-coded string ...
someID/pswd@db_name

... and we've tried %username%

I think I am probably not searching correctly, I cannot be the first person to ask this question ...

We need this to be simple, work everywhere. We are not so much concerned with security ... our users have already authenticated to the Windows domain server, and an environment variable is "out there" ...

If we could be pointed in the correct direction, that would be great.

Thanks for your time and help.

Suzanne

Comments

Matej D.

Hi,

you can use webutil to get OS username.

Regards

tony.g

Hi

You don't have to specify the username in the formsweb.cfg config section you are using.

You can pass it in the URL you use to start the forms session.

forms/frmservlet?config=mycfg&userid=user@orcl

You need to decide how you build the URL in order to get the desired username into the string


Tony

HamidHelal

Ok. Let me search at google.com for you

Search String: how to get os user name from oracle forms


and get

1. how to get OS User Name ?

2. https://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:31051406979835

So ??

Hamid

SM_Work

Tony, thanks for that clue.

I am unclear on passing in those variables.

(and these are from windows machines, and ... sigh, most likely IE, it is what it is)

The user's ID is in a long-established system variable name "USERNAME" ...

in the DOS environ, I would just use "%USERNAME%" and that worked brilliantly.

I don't want to put the user's password in the string, but the user _might_ want to change the database into which they are logging (we have 6 DBs, typically users log in to "PROD" or "TSTB" (our dynamic test environ) and occasionally "TSTA" (our static test environ) ... we _could_ give users separate links for each DB, no problem).

But I am really unclear on the variable passing ... Forms 11g is a new environment for us ... I just don't quite get the examples yet.

(I _have_ set up Forms 6i to run on Win2k8R2 64-bit, against an 11g database, so I am not completely clueless.)

Thanks for your time and help with this.

Suzanne

SM_Work

Hamid, I am aware of various ways to get a userid _from_ within the database or a form (the links summarize them to be sure, thanks for that). What I need is ... how do I pass the operating system user id _INTO_ the database when calling our opening form, the form that calls all the others and that will set up the forms environment for the user (whether in the middle tier or in the DB session). Once the user is logged in, no problem. But precisely _how_ to log the user in (which was clear in Forms 6i, at least to me) ... I would _love_ a good example.

The examples I have found are unclear. Using WebUtil is also not clear. Occasionally, I am just stupid.

Thanks for your time and help. And patience.

SM

HamidHelal

SM_Work wrote:

Hamid, I am aware of various ways to get a userid _from_ within the database or a form (the links summarize them to be sure, thanks for that). What I need is ... how do I pass the operating system user id _INTO_ the database when calling our opening form, the form that calls all the others and that will set up the forms environment for the user (whether in the middle tier or in the DB session). Once the user is logged in, no problem. But precisely _how_ to log the user in (which was clear in Forms 6i, at least to me) ... I would _love_ a good example.

The examples I have found are unclear. Using WebUtil is also not clear. Occasionally, I am just stupid.

Thanks for your time and help. And patience.

SM

First of all you have to familiar with webutil. few 6i features will not work from 10g on words.

For example

6i is a client/server based. where from 10g it's client/web /server based. eg. Your database in say USA and you are using application from UK. how will you get operating system ID ?

where application has no bound.

Hope it helps

SM_Work

Hamid,
Thanks for the reply.
Yes, I do need to familiarize myself with WebUtil.


In case of this application, it is / will be accessed from various parts of New York City. It is completely irrelevant to rest of world and entirely behind a firewall. In the case of our userbase, whatever workstation they've logged into ... _it_ has a variable in the OS environ that has their username. Since the user invokes the forms web page from a workstation that has their UID in the OS, that variable should be able to be passed into the application, to "log them in" ... unless you're telling me that users no longer log in to applications. Password is semi-irrelevant, since the user's workstation has authenticated them to the WAN / work domain. All the user should have to do is choose the database they wish to access.

So ... I'd like the webutil bit to be something like ...

[forms string]/?user=%USERNAME%/[etc.]

... where "username" gets picked up from that local OS.

That's what we're looking at how to do ...

Kind regards,

Suzanne

HamidHelal

SM_Work wrote:

Hamid,
Thanks for the reply.
Yes, I do need to familiarize myself with WebUtil.


In case of this application, it is / will be accessed from various parts of New York City. It is completely irrelevant to rest of world and entirely behind a firewall. In the case of our userbase, whatever workstation they've logged into ... _it_ has a variable in the OS environ that has their username. Since the user invokes the forms web page from a workstation that has their UID in the OS, that variable should be able to be passed into the application, to "log them in" ... unless you're telling me that users no longer log in to applications. Password is semi-irrelevant, since the user's workstation has authenticated them to the WAN / work domain. All the user should have to do is choose the database they wish to access.

So ... I'd like the webutil bit to be something like ...

[forms string]/?user=%USERNAME%/[etc.]

... where "username" gets picked up from that local OS.

That's what we're looking at how to do ...

Kind regards,

Suzanne

How your user open/run the application ?

1. Open the browser and type the url

Or

2. A pre-maded shortcut

Or How ?

Please give us details about the application starting.

Suzanne,

Generally, I would not recommend getting the username by relying on a system variable since they can be changed.  I can offer these suggestions:

1.  Use the Forms default logon dialog and let users enter their own information

2.  Create your own custom logon form.  You can use WebUtil to capture the client OS username.

3.  Use sso.  You may be able to use Windows Native Authentication integrated with Oracle Access Manager (and WebGate).  Refer to the following:

http://docs.oracle.com/cd/E27559_01/admin.1112/e27239/wna.htm

http://docs.oracle.com/cd/E48391_01/doc.11120/e24477/sso.htm

CraigB

SM_Work wrote:

...

So ... I'd like the webutil bit to be something like ...

[forms string]/?user=%USERNAME%/[etc.]

... where "username" gets picked up from that local OS.

That's what we're looking at how to do ...

...

The "webutil_clientinfo.get_user_name" function will return the OS Client user name.  You can't use WebUtil in a Pre-Form trigger so you would need to call this function in a When-New-Form-Instance trigger.  You could use this function to get the client user name and store it in a Forms variable that is used in place of %USERNAME%.

SM_Work wrote:

...
In case of this application, it is / will be accessed from various parts of New York City. It is completely irrelevant to rest of world and entirely behind a firewall. In the case of our userbase, whatever workstation they've logged into ... _it_ has a variable in the OS environ that has their username. Since the user invokes the forms web page from a workstation that has their UID in the OS, that variable should be able to be passed into the application, to "log them in" ... unless you're telling me that users no longer log in to applications. Password is semi-irrelevant, since the user's workstation has authenticated them to the WAN / work domain. All the user should have to do is choose the database they wish to access.

...

It sounds like you are using some type of "Home Grown" Single-Sign-on (SSO).  If this is true, you might want to rethink this and implement an actual SSO process instead of something that happens 'under the covers' so to speak.


Craig...

lake

have you tried?:

get_application_property(USERNAME);

SM_Work

We got it to work using WebUtil and a clever opening form (and clever developers).

But all your ideas and suggestions contributed to that, so we appreciate it very much.

(I will post what we did, but not right now, I just logged in to ask a different question).

1 - 12
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 21 2014
Added on Jul 7 2014
12 comments
4,925 views