C# Class HttpServer.Authentication.AuthenticationProvider

Provides authentication in the web server.
To initiate authentication you just need to throw a Una
Exibir arquivo Open project: NyxStudios/HttpServer Class Usage Examples

Public Methods

Method Description
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.

Method Details

Add() public method

Add a authenticator.
public Add ( IAuthenticator authenticator ) : void
authenticator IAuthenticator
return void

Authenticate() public method

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
return IAuthenticationUser

CreateChallenge() public method

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
return void