Table of Contents

Class ValidPlatformAttribute

Namespace
ZapLib.Security
Assembly
ZapLib.dll

平台驗證標籤,加上該標籤的 Action 都會進行平台驗證檢查,檢查失敗將回傳 401 Unauthorized,且不會進入 Action

public class ValidPlatformAttribute : AuthorizeAttribute, _Attribute, IAuthorizationFilter, IFilter
Inheritance
ValidPlatformAttribute
Implements
Inherited Members

Methods

IsVaild(string, string, string, string)

內對內 API 驗證平台是否可被信任

public bool IsVaild(string content, string IV, string Authorization, string OuterSignature)

Parameters

content string

HTTP Request.Content 字串內容

IV string

加密種子

Authorization string

以 Signature + Iv + 系統金鑰 使用 DES 雜湊後的結果

OuterSignature string

簽章,將傳送的資料以 MD5 加密後的字串

Returns

bool

這個請求是否可被信任

OnAuthorization(HttpActionContext)

Web API 進入 Action 會執行這個方法驗證

public override void OnAuthorization(HttpActionContext actionContext)

Parameters

actionContext HttpActionContext

WebAPI HttpActionContext