Skip to main content
Inspiring
August 28, 2008
Question

Nt username

  • August 28, 2008
  • 25 replies
  • 2497 views
How to get nt username using CF? Please anyone, thanks....
    This topic has been closed for replies.

    25 replies

    Inspiring
    September 3, 2008
    Azadi wrote:
    > just run wsconfig.exe

    And there would be no problem having two web serves running both serving
    up ColdFusion pages?

    I would presume not if the two web servers are running on different
    ports, but I have to say I have never tried this. Or even conceived it
    before now.

    Following this line of thought, it should be possible to have
    ColdFusion's built in web server, IIS and Apache all serving up
    ColdFusion applications on the same Windows OS as long as each web
    server has it's own port, correct.

    I'm not sure why one would really want all that, but I'm almost geeky
    enough just to try it someday if I ever have some spare time.

    Inspiring
    September 3, 2008
    you might think that weissbier has hampered with my typing, too... but i
    prefer to blame it on the lame keyboard on this acer lap...

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/
    Inspiring
    September 3, 2008
    just run wsconfig.exe located in {cf_install_dir}/runtime/bin, or,
    easier, you should have a Web Server Configuration Tool item in your
    Start > All Programs > Adobe > Coldfusion 8 [or Start > All Programs >
    Macromedia > Coldfusion MX 7]

    it should automatically see your IS server an let you configure it. just
    select "All IIS Websites" option and click OK.

    You will then have to go into IIS Management Console and delete
    iisstart.aps in Default Document tab, otherwise your server will keep
    prompting you for a username and password.

    NOTE: this all is from memory, which has been hampered by a couple of
    Weihenstephan Heffe Weissbier glasses...

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/
    Inspiring
    September 3, 2008
    emmim44 wrote:
    I execute a CF page using http://localhost:8500 since it is built in
    server...
    My IIS is set up.
    My environment is intranet...
    I am using my local machine as cf server...
    etc

    Well if you have CF's built in server and IIS set up then you have two
    web servers running. One on port 8500 serving ColdFusion pages and
    another, probably on port 80, that knows who you are because of it's
    'Windows Integrated' security feature.

    Obviously you need to get this consolidated into one web server that
    both runs ColdFusion and knows how to use Windows Integrated security to
    inform you of who is using your CF applications.

    In other words you need to reconfigure your ColdFusion application
    server to utilize your IIS web server. Unfortunately I cannot advice
    you on how this is done after ColdFusion has been installed. I have
    *always* configured my CF to use IIS when I install it.

    All of this is on your local machine correct?
    emmim44Author
    Inspiring
    September 3, 2008
    Answer 2 Ian Skinner >> Yes
    Azadi, I am at web server configuration but my "OK" button is disabled means that I cannot continue... What does that indicate?
    emmim44Author
    Inspiring
    September 3, 2008
    I execute a CF page using http://localhost:8500 since it is built in server... My IIS is set up. My environment is intranet...I am using my local machine as cf server...etc
    Inspiring
    September 3, 2008
    emmim44 wrote:
    > The output from #CGI.AUTH_USER# after turning on the 'Integrated Authentication' is nada... I am running my local CF server as built in...
    > How would I do that?

    Well the built in CF web server is not 'Windows' so it does not play
    with 'Windows Integrated Authentication', but then you shouldn't have
    the IIS management console where one would "turn on 'Integrated
    Authentication'", if you are not using IIS as your web server.

    So can you explain your server configuration here? What is your web
    server? Where is your ColdFusion server? How have they been tied together?
    emmim44Author
    Inspiring
    September 3, 2008
    The output from #CGI.AUTH_USER# after turning on the 'Integrated Authentication' is nada... I am running my local CF server as built in...
    How would I do that?
    Inspiring
    September 3, 2008
    tclaremont wrote:
    > In my case I use the following, since I know my
    > domain and the slash are ten characters long: <CFSET VisitorName =
    > #lcase(removeChars(cgi.auth_user, 1, 10))#>

    A slightly easier way to do this, that does not require one 'knowing'
    one's domain. Even though that should be well known.

    <cfset userName = listLast(cgi.auth_user,"\")>
    <cfset domain = listFirst(cgi.auth_user,"\")>
    tclaremont
    Inspiring
    September 3, 2008
    As has been mentioned before in this thread....

    IF you are using Internet Information Services and you have Integrated Authentication turned on (a checkbox within IIS), you can use the cgi variable #CGI.AUTH_USER#.

    This will return the doman name and username of the person logged into the computer visiting your site. If you are unsure of your envrionment, go ahead and put #CGI.AUTH_USER# on a blank page and run the page. What do you get? When YOU view the page on your intranet it should return your domain/username.

    Using simple string functions you can trim the domain name, since you KNOW what the domain name will be. In my case I use the following, since I know my domain and the slash are ten characters long: <CFSET VisitorName = #lcase(removeChars(cgi.auth_user, 1, 10))#>

    With this information, I can do a quick lookup in my user database to determine the permissions for the user in question, using the variable I set above as #VisitorName#.

    If the user tries to access a section of the site that they do NOT have permissions for, or in the bizzare case where the username is undefined, I use CFLOCATION to transport them to an Access Request Page. They fill out the request form, and ColdFusion emails it to me. I change the requestors permissions in the database and they are then allowed to view the originally requested page.
    emmim44Author
    Inspiring
    September 2, 2008
    It is a intranet environment... not external web...