C# Class WebApiDoodle.Web.Filters.ApiKeyAuthAttribute

QueryString Api Key Authorization filter for ASP.NET Web API.
Inheritance: System.Web.Http.Filters.AuthorizationFilterAttribute
ファイルを表示 Open project: tugberkugurlu/WebAPIDoodle

Public Methods

Method Description
ApiKeyAuthAttribute ( string apiKeyQueryParameter, Type apiKeyAuthorizerType ) : System

OnAuthorization ( System.Web.Http.Controllers.HttpActionContext actionContext ) : void

Protected Methods

Method Description
HandleUnauthorizedRequest ( System.Web.Http.Controllers.HttpActionContext actionContext ) : void

Handles the operation on an unauthorized situation

Private Methods

Method Description
AuthorizeCore ( HttpRequestMessage request ) : bool
IsAuthorized ( string apiKey ) : bool
IsTypeOfIApiKeyAuthorizer ( Type type ) : bool
SkipAuthorization ( System.Web.Http.Controllers.HttpActionContext actionContext ) : bool
SplitString ( string original ) : string[]

Method Details

ApiKeyAuthAttribute() public method

public ApiKeyAuthAttribute ( string apiKeyQueryParameter, Type apiKeyAuthorizerType ) : System
apiKeyQueryParameter string The name of the query string parameter whose value needs to be compared against.
apiKeyAuthorizerType System.Type Type of Api Key Authorizer which implements TugberkUg.Web.Http.IApiKeyAuthorizer
return System

HandleUnauthorizedRequest() protected method

Handles the operation on an unauthorized situation
protected HandleUnauthorizedRequest ( System.Web.Http.Controllers.HttpActionContext actionContext ) : void
actionContext System.Web.Http.Controllers.HttpActionContext
return void

OnAuthorization() public method

public OnAuthorization ( System.Web.Http.Controllers.HttpActionContext actionContext ) : void
actionContext System.Web.Http.Controllers.HttpActionContext
return void