2010-06-14 1 views
1

Windows 인증에서 SharePoint 사이트와 사용자 지정 aspx 포털을 모두 보유하고 있습니다. 동일한 컴퓨터에서 내 Sharepoint 사이트가 내 현재 로그인을 반환하고 사용자 정의 aspx는 내 도메인 관리자 계정을 대신 반환합니다.Sharepoint UserProfileService

어쨌든 로그인이 모두 동일 할 수 있습니까? 그렇지 않으면 어쨌든 사용자 지정 aspx 포털에서 SPUserProfileService를 사용합니까?

주로, 공유 지점 로그온 ID를 얻으려면 사용자 지정 aspx 포털이 있어야합니다. 그럼에도 불구하고 나는 로그인을 요구하는 셰어 포인트에서 AccessDenied.aspx를 여전히 트리거 할 수 있습니다.

답변

0

"사용자 지정 ASPX Portal"이라고 말하면 SharePoint 사이트에서 계속 호스팅됩니까?

그런 경우 어떻게 사용자를 얻나요? SPContext.Current.Web.CurrentUser를 사용하여 사용자를 가져올 수 있습니다.

0

도메인 관리자 계정을 사용하여 사용자 지정 aspx에서 SharePoint로 연결하는 것 같습니다. 사용자 정의 aspx 포털 및 사용자 이름을 읽는 방법에 대해 자세히 설명해 주시겠습니까? Possible ways to get logged in User Name & Handling Changes in FBA Users' Names if Membership Provider Name Changed

public string GetFlatUserName() 
{ 
    //First, be sure that the user is not anonymous user: 
    if (SPContext.Current == null || SPContext.Current.Web.CurrentUser == null) 
     return "Anonymous"; 
    //Second, parse it: 
    else 
    { 
     string flatUserName = this.Page.User.Identity.Name; 
     if (flatUserName.Contains("\\")) 
     { 
      flatUserName = flatUserName.Substring(flatUserName.IndexOf("\\") + 1); 
     } 
     else if (flatUserName.Contains("|")) 
     { 
      flatUserName = flatUserName.Substring(flatUserName.IndexOf("|") + 1); 
     } 
     return flatUserName; 
    } 
} 
:

그러나, 당신은 나의 기사 확인할 수 있습니다 (이 FBA 사용자를위한 것입니다 비록을, 당신은 유용한 코드를 찾을 수 있습니다)