From 8c1928946cb3b4f2d9ead70c7362ce1dbe045fa4 Mon Sep 17 00:00:00 2001 From: ulrich Date: Mon, 05 Jul 2021 10:53:23 +0000 Subject: [PATCH] Log-Eintraege fuer log in --- src/de/uhilger/httpserver/oauth/BearerLoginHandler.java | 18 +++++++++++++++--- 1 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/de/uhilger/httpserver/oauth/BearerLoginHandler.java b/src/de/uhilger/httpserver/oauth/BearerLoginHandler.java index 3fda7b8..e833045 100644 --- a/src/de/uhilger/httpserver/oauth/BearerLoginHandler.java +++ b/src/de/uhilger/httpserver/oauth/BearerLoginHandler.java @@ -23,8 +23,8 @@ import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; import de.uhilger.httpserver.auth.realm.User; -import de.uhilger.httpserver.base.handler.HttpHelper; -import de.uhilger.httpserver.base.handler.HttpResponder; +import de.uhilger.httpserver.base.HttpHelper; +import de.uhilger.httpserver.base.HttpResponder; import java.io.IOException; import java.util.logging.Logger; @@ -77,6 +77,12 @@ "refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA" } */ + /** + * Login-Anfragen ausfuehren + * + * @param exchange das Objekt mit Informationen zu HTTP-Anfrage und -Antwort + * @throws IOException + */ @Override public void handle(HttpExchange exchange) throws IOException { HttpContext context = exchange.getHttpContext(); @@ -84,7 +90,7 @@ if (o instanceof BearerAuthenticator) { BearerAuthenticator auth = (BearerAuthenticator) o; User user = getUser(exchange); - LoginResponse response = auth.login(user.getName(), user.getPassword()); + LoginResponse response = auth.login(exchange, user.getName(), user.getPassword()); handleLoginResponse(exchange, response); } else { HttpResponder r = new HttpResponder(); @@ -92,6 +98,12 @@ } } + /** + * Die Antwort des Authenticators auf eine Login-Anfrage verarbeiten + * @param exchange das Objekt mit Informationen zu HTTP-Anfrage und -Antwort + * @param response die Antwort des Autehnticators + * @throws IOException + */ protected void handleLoginResponse(HttpExchange exchange, LoginResponse response) throws IOException { if(response != null) { setLoginHeader(exchange); -- Gitblit v1.9.3