Getting user name from Mojo Cookie?

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
7/19/2012 12:52:54 AM
Gravatar
Total Posts 68

Getting user name from Mojo Cookie?

Hi Joe,

On the INTRAnet I have LDAP enabled to authenticate the staff in my company.

I have a seperate web application done in asp.net which used to read the request.ServerVariables("AUTH_USER") after the user has logged in to Mojo and then allow/disallow certain options.

I recently upgraded to a new server running Windows 2008 R2 and  IIS 7 and MS SQL 2008 with Mojo 2.3.8.5 MSSQL

Now that web app returns the AUTH_USER as blank. The old IIS server was set to Anonymous Authentication and Integrated Windows Authentication and so I did the same for the new server too. On the old server the app works fine, returning the logged in user in the AUTH_USER variable. But on the new server this is not the case.

Is there a way I can get the logged in users name by reading any Mojo variables or cookies to make this app work instead?

best regards,

Dominique

7/19/2012 12:33:27 PM
Gravatar
Total Posts 18439

Re: Getting user name from Mojo Cookie?

I think your app would have to run in the same application context as mojoPortal to read its cookies. 

if(Request.IsAuthenticated)

string userName = Context.User.Identity.Name;

}

If you add this in user.config:

<add key="EnableDeveloperMenuInAdminMenu" value="true" />

it enables a tool in mojoPortal to see all the server variables under Administration > Advanced Tools > Developer Tools > Server Variables

However depending on configuration what you see there may not be the same as what you will see in your custom app.

You must sign in to post in the forums. This thread is closed to new posts.