티스토리 뷰
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
- java 키워드 정리
- System.Diagnostics
- await
- In App Purchase
- MainActor
- java-개발 환경 설정하기
- jstl(java standard tag library)
- 표현 언어(expression language)
- jstl(java standard tag library)-core
- system.io
- java web-mvc
- nl2br
- 문자 자르기
- 진수 변환
- 제품 등록
- error-java
- jsp 오픈 소스
- 특정 문자를 기준으로 자르기
- 스프링 시큐리티(spring security)-http basic 인증
- REST API
- React
- 인텔리제이(intellij)
- java.sql
- 람다식(lambda expression)
- .submit()
- 메이븐(maven)
- docker
- 스프링 시큐리티(spring security)
- 스프링 프레임워크(spring framework)
- 스프링 프레임워크(spring framewordk)
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |