Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Worksite Web Trusted login
System
Can anyone tell me how to get an aspx web page to perform a trusted login to worksite web 8.
The workstations accessing the web page are XP, using Active directory for log in. Desksite performs a trusted login, worksite web standard login pge performs a trusted login but if I write an aspx page as follows, only the named login works:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim iNRTDMS as iManage.ManDMS
Dim iSession as iManage.iManSession
Dim iDb As IManage.IManDatabase
iNRTDMS = New IManage.ManDMS
iSession = iNRTDMS.Sessions.Add("192.168.0.100")
'iSession.Login(strUserID, strPswd)
iSession.TrustedLogin()
iDb = iSession.Databases.ItemByIndex(1)
If Not IsPostBack Then
'get application settings from xml file
ReadXMLSettings()
End If
End Sub
Find more posts tagged with
Comments
dabird
IManSession.TrustedLogin() is used for a desktop client, whereas IManSession.TrustedLogin2() is used for a web client (see the IManSession object in the COM Reference Manual, approx. page 207, for details on TrustedLogin vs. TrustedLogin2). What you need to do is create an access token for the user who is making the request from the client machine. You then convert the token to a long value and pass the value to TrustedLogin2. For details on creating an access token using .Net, see the following on MSDN:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebhttpworkerrequestclassgetusertokentopic.asp
'HttpWorkerRequest.GetUserToken() returns System.IntPtr
System.IntPtr accessToken = 'get your token;
'this call will work for web-based apps
IManSession.TrustedLogin2(accessToken.ToInt32());
Migrateduser
I've tried this but get a trusted login access is denied error from the login page. I've checked that trusted login is enabled, and I can perform a trusted login from the worksite web login page OK.
here is the code
Dim accessToken As Long
accessToken = System.Security.Principal.WindowsIdentity.GetCurrent().Token.ToInt32
iNRTDMS = New IManage.ManDMS
iSession = iNRTDMS.Sessions.Add("192.168.0.100")
iSession.TrustedLogin2(accessToken)
Any ideas?
Migrateduser
Got this working now.
Silly mistake. I forgot to add the
<identity impersonate="true"/>
to the web.config file, thanks for the help.
Paul.