C# Класс HttpServer.Authentication.AuthenticationProvider

Provides authentication in the web server.
To initiate authentication you just need to throw a Una
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
Add ( IAuthenticator authenticator ) : void

Add a authenticator.

Authenticate ( IRequest request ) : IAuthenticationUser

Authenticate request.

Requires that a AuthorizationHeader have been sent by the client. If not, request one by sending a WWW-Authentication header (can be generated by the Challenge method).

CreateChallenge ( IResponse response, string realm ) : void

Create a challenge header (WWW-authenticate)

Scheme can currently be basic or digest. Basic is not very safe, but easier to use. Digest is quite safe.

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

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

Add a authenticator.
public Add ( IAuthenticator authenticator ) : void
authenticator IAuthenticator
Результат void

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

Authenticate request.
Requires that a AuthorizationHeader have been sent by the client. If not, request one by sending a WWW-Authentication header (can be generated by the Challenge method).
Authorization header was not found in the request. Requested authentication scheme is not supported.
public Authenticate ( IRequest request ) : IAuthenticationUser
request IRequest
Результат IAuthenticationUser

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

Create a challenge header (WWW-authenticate)

Scheme can currently be basic or digest. Basic is not very safe, but easier to use. Digest is quite safe.

Requested scheme is not supported.
public CreateChallenge ( IResponse response, string realm ) : void
response IResponse Response that the authentication header should be added to
realm string Realm that the user should authenticate in
Результат void