C# Класс GoatTrip.RestApi.Authentication.BasicAuthenticationModule

This module performs basic authentication. For details on basic authentication see RFC 2617. Based on the work by Mike Volodarsky (www.iis.net/learn/develop/runtime-extensibility/developing-a-module-using-net) The basic operational flow is: On AuthenticateRequest: extract the basic authentication credentials verify the credentials if succesfull, create and send authentication cookie On SendResponseHeaders: if there is no authentication cookie in request, clear response, add unauthorized status code (401) and add the basic authentication challenge to trigger basic authentication.
Наследование: IHttpModule
Показать файл Открыть проект

Открытые методы

Метод Описание
Dispose ( ) : void
Init ( System.Web.HttpApplication context ) : void

Защищенные методы

Метод Описание
ExtractBasicCredentials ( string authorizationHeader, string &username, string &password ) : bool
ValidateCredentials ( string userName, string password ) : bool

Приватные методы

Метод Описание
AuthenticateUser ( Object source, EventArgs e ) : void
InitCredentials ( string username, string password ) : void
InitExcludes ( Devbridge.BasicAuthentication.Configuration basicAuth ) : void
IsRedirect ( int httpStatusCode ) : bool
IsStatusOK ( int httpStatusCode ) : bool
IssueAuthenticationChallenge ( Object source, EventArgs e ) : void
ShouldChallenge ( HttpContext context ) : bool

Returns true if authentication challenge should be sent to client based on configured exclude rules

Описание методов

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

ExtractBasicCredentials() защищенный Метод

protected ExtractBasicCredentials ( string authorizationHeader, string &username, string &password ) : bool
authorizationHeader string
username string
password string
Результат bool

Init() публичный Метод

public Init ( System.Web.HttpApplication context ) : void
context System.Web.HttpApplication
Результат void

ValidateCredentials() защищенный Метод

protected ValidateCredentials ( string userName, string password ) : bool
userName string
password string
Результат bool