Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...DNN and ServervariablesDNN and Servervariables
Previous
 
Next
New Post
8/5/2013 7:25 AM
 

Hi,

 I am pretty new to DNN and developing a module for use in Intranet use (using DNN7.1). Therefore I have to read the Servervariable "LOGON_USER" to identify which User is accessing the page. To test this I tried some simple aspx-Files, which will give you the User. So the Server actually sets this Variable.

But when I want to get the Users from within my written Module i will always get an empty String or host, if I am logged in as host.

The Code I am using is (C#):

Request.ServerVariables.Get("LOGON_USER") 

Am I missing something important? Anyone knows help?

 

 
New Post
8/9/2013 4:47 PM
 
Some of the servervariables are deprecated and not recommended for use - see http://forums.asp.net/t/1917277.aspx/1 for an example of an alternative (though when using windows auth HttpContext.Current.User.Identity.Name works well , or of course you can use the DNN code to get the user object and then use any of it's properties i.e. UserInfo objUserInfo = UserController.GetCurrentUserInfo();

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
8/12/2013 11:02 AM
 

Thanks for the answer!

I tried the alternativ mentioned in the forum you refered and got an Error message:

 A critical error has occurred. Could not load type 'System.Security.Claims.ClaimsIdentity' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

On Serverside Windows Auth, Basic Auth and Annonymus Auth are activated. 

 Then I wanted to turn Windows Authentication on, by changing the web.config to:

   <!-- Forms or Windows authentication
    <authentication mode="Forms">
      <forms name=".DOTNETNUKE" protection="All" timeout="60" cookieless="UseCookies" />
    </authentication>-->
    
    <identity impersonate="true"/>
    <authentication mode="Windows">
    </authentication>
    <!-- -->

  But nothing changed by doing that.

I also searched for the Authentication Provider in : Host-->Extensions--> Authethication Systems --> default provider but there was nothing to edit, only readable labels:

 

DNN
DesktopModules/AuthenticationServices/DNN/Login.ascx
DesktopModules/AuthenticationServices/DNN/Settings.ascx

True

 

Also in Host --> Extensions --> Authentication (Module) there was nothing about Windows authenthication:

Add Definition
Account Login
Control Title Source
DesktopModules/Admin/Authentication/Login.ascx

select

So how do I set up the Windows Authenttication? I found some Forum where it is explained for older Versions but everytime there is an menu explaind in which you can choose Windows Authentication or Active Directory which is not available in my DNN-Version (7.1).

Can someone give me some hints?





 

 
New Post
8/12/2013 6:27 PM
 

my apologies, I linked the wrong article, I meant to paste http://forums.asp.net/t/1179997.aspx. In essence logon_user and User.Identity.Name both return the same value which is that of the logged in accessing user. If a user is anonymous (as is the case of an internet site), it will be blank and you will have to use the DNN code I suggested. 

Note:  you should not make a site use windows auth/active directory unless you need those for other things e.g. an intranet site.


Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
8/13/2013 4:20 AM
 

 Thanks again for the Link and sorry I am still not able to get it running!

As I use DNN for Intranet i will use the Windows authentication.

I changed now the IIS Settings to only allow Windows Auhentication. Afterwards the Login vanished I got the always the 404 Error Page (for every Page):

"Sorry, the page you are looking for cannot be found and might have been removed, had its name changed, or is temporarily unavailable. It is recommended that you start again from the homepage. Feel free to contact us if the problem persists or if you definitely cannot find what you’re looking for."
As URL it is always: HomepageURL/Account/Login?ReturnUrl=...

No matter what i change in the web.config the Error is not changing.

  <authentication mode="Forms">
      <forms name=".DOTNETNUKE" protection="All" timeout="60" cookieless="UseCookies" />
    </authentication>

Or using:

    <identity impersonate="true"/>
    <authentication mode="Windows">
    </authentication>

1) Do you maybe know why  I get this Error and how to fix it?

2) In the Link I found some Code like this:

<authentication mode="Windows|Forms|Passport|None"> </authentication>

Is it possible to run Windows and Form Authentication at the same time? (Like standard is Windows, but you can Login as Superuser) with something like this?

<identity impersonate="true"/>
    <authentication mode="Windows|Forms">
      <forms name=".DOTNETNUKE" protection="All" timeout="60" cookieless="UseCookies" />
    </authentication>-->
 I am really sorry if I am asking obvious questions, but i am not very familiar with web technology.

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...DNN and ServervariablesDNN and Servervariables


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out