C# Class HttpServer.Authentication.AuthenticationProvider

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

Méthodes publiques

Méthode 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 méthode

Add a authenticator.
public Add ( IAuthenticator authenticator ) : void
authenticator IAuthenticator
Résultat void

Authenticate() public méthode

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
Résultat IAuthenticationUser

CreateChallenge() public méthode

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
Résultat void