|
이 문서는 수동으로 번역한 것입니다. 원본 텍스트를 보려면 포인터를 문서의 문장 위로 올리십시오. 추가 정보
|
번역
원본
|
Reporting Services의 인증
public bool LogonUser(string userName, string password, string authority)
{
return AuthenticationUtilities.VerifyPassword(userName, password);
}
internal static bool VerifyPassword(string suppliedUserName,
string suppliedPassword)
{
bool passwordMatch = false;
// Get the salt and pwd from the database based on the user name.
// See "How To: Use DPAPI (Machine Store) from ASP.NET," "How To:
// Use DPAPI (User Store) from Enterprise Services," and "How To:
// Create a DPAPI Library" for more information about how to use
// DPAPI to securely store connection strings.
SqlConnection conn = new SqlConnection(
"Server=localhost;" +
"Integrated Security=SSPI;" +
"database=UserAccounts");
SqlCommand cmd = new SqlCommand("LookupUser", conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter sqlParam = cmd.Parameters.Add("@userName",
SqlDbType.VarChar,
255);
sqlParam.Value = suppliedUserName;
try
{
conn.Open();
SqlDataReader reader = cmd.ExecuteReader();
reader.Read(); // Advance to the one and only row
// Return output parameters from returned data stream
string dbPasswordHash = reader.GetString(0);
string salt = reader.GetString(1);
reader.Close();
// Now take the salt and the password entered by the user
// and concatenate them together.
string passwordAndSalt = String.Concat(suppliedPassword, salt);
// Now hash them
string hashedPasswordAndSalt =
FormsAuthentication.HashPasswordForStoringInConfigFile(
passwordAndSalt,
"SHA1");
// Now verify them. Returns true if they are equal.
passwordMatch = hashedPasswordAndSalt.Equals(dbPasswordHash);
}
catch (Exception ex)
{
throw new Exception("Exception verifying password. " +
ex.Message);
}
finally
{
conn.Close();
}
return passwordMatch;
}
-
클라이언트 응용 프로그램에서 사용자를 인증하도록 웹 서비스 LogonUser 메서드를 호출합니다. -
웹 서비스에서 보안 확장 프로그램, 특히 IAuthenticationExtension을 구현하는 클래스의 LogonUser 메서드를 호출합니다. -
LogonUser 구현에서 사용자 저장소 또는 보안 기관에 있는 사용자 이름과 암호를 검사합니다. -
인증이 성공하면 웹 서비스에서 쿠키를 만들고 세션을 위해 관리합니다. -
웹 서비스는 HTTP 헤더에서 인증 티켓을 호출 응용 프로그램에 반환합니다.
참고
|
|---|
|
|
-
Microsoft Windows 계정이 없는 사용자를 저장하고 인증해야 하는 경우 및 -
웹 사이트의 다양한 페이지 사이에서 고유의 사용자 인터페이스 양식을 로그온 페이지로 제공해야 하는 경우
-
폼 인증을 사용하는 경우 IIS(인터넷 정보 서비스)에서 보고서 서버 가상 디렉터리에 대해 익명 액세스를 사용하도록 설정해야 합니다. -
ASP.NET 인증은 폼 인증으로 설정해야 합니다. 보고서 서버의 경우 Web.config 파일에서 ASP.NET 인증을 구성합니다. -
Reporting Services는 Windows 인증 또는 사용자 지정 인증으로 사용자를 인증하고 권한을 부여할 수 있으며, 두 가지 인증을 모두 사용할 수는 없습니다. Reporting Services에서는 여러 보안 확장 프로그램을 동시에 사용할 수 없습니다.

참고