티스토리 뷰
public class AuthorizationAttribute : FilterAttribute, IAuthorizationFilter
{
void IAuthorizationFilter.OnAuthorization(AuthorizationContext filterContext)
{
HttpCookie cookie = filterContext.RequestContext.HttpContext.Request.Cookies.Get("AccessToken");
Controller controller = filterContext.Controller as Controller;
if (cookie == null || string.IsNullOrEmpty(WebConfig.SessionUserID))
{
controller.HttpContext.Response.Redirect(redirectUrl);
//filterContext.Result = new RedirectToRouteResult( new RouteValueDictionary {
// { "controller", "Home" }
// , { "action", "Index" }
//});
}
if (!this.dataEncryption.PBKDF2Compare(cookie.Value, this.dataEncryption.PBKDF2(this.dataEncryption.SHA1Decrypt(WebConfig.SessionUserID, WebConfig.Salt), WebConfig.Salt, int.Parse(WebConfig.Iteration))))
{
controller.HttpContext.Response.Redirect(redirectUrl);
}
}
private DataEncryption dataEncryption = new DataEncryption();
private string redirectUrl = WebConfig.SignInUrl;
public string RedirectUrl
{
get { return redirectUrl; }
set { redirectUrl = value; }
}
}
- Total
- Today
- Yesterday
- mssql
- 앱 스토어
- 명령어
- 문자 자르기
- async
- await
- App Store
- .submit()
- nl2br
- System.Diagnostics
- MainActor
- Task
- In App Purchase
- system.io
- FileUpload
- html tag
- 상품 등록
- 진수 변환
- 아이폰
- 공백제거
- hyper-v
- 특정 문자를 기준으로 자르기
- trim
- 제품 등록
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |