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/BearerRefreshHandler.java | 22 +++++++++++++++++++--- 1 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/de/uhilger/httpserver/oauth/BearerRefreshHandler.java b/src/de/uhilger/httpserver/oauth/BearerRefreshHandler.java index ee5a4ac..17a4dcd 100644 --- a/src/de/uhilger/httpserver/oauth/BearerRefreshHandler.java +++ b/src/de/uhilger/httpserver/oauth/BearerRefreshHandler.java @@ -19,20 +19,36 @@ import com.sun.net.httpserver.HttpContext; import com.sun.net.httpserver.HttpExchange; -import com.sun.net.httpserver.HttpHandler; -import de.uhilger.httpserver.base.handler.HttpHelper; -import de.uhilger.httpserver.base.handler.HttpResponder; +import de.uhilger.httpserver.base.HttpHelper; import static de.uhilger.httpserver.oauth.BearerLoginHandler.ATTR_AUTHENTICATOR; import java.io.IOException; /** + * Einen abgelaufenen Token mit Hilfe eines Refresh Token erneuern * + * Gemaess + * https://www.oauth.com/oauth2-servers/making-authenticated-requests/refreshing-an-access-token/ + * sieht die HTTP Anfrage zum Refresh wie folgt aus: + * + * POST /oauth/token HTTP/1.1 + * Host: authorization-server.com + * + * grant_type=refresh_token + * &refresh_token=xxxxxxxxxxx + * &client_id=xxxxxxxxxx + * &client_secret=xxxxxxxxxx * * @author Ulrich Hilger * @version 1, 08.06.2021 */ public class BearerRefreshHandler extends BearerLoginHandler { + /** + * Refresh-Anfrage ausfuehren + * + * @param exchange das Objekt mit Informationen zu HTTP-Anfrage und -Antwort + * @throws IOException + */ @Override public void handle(HttpExchange exchange) throws IOException { HttpHelper h = new HttpHelper(); -- Gitblit v1.9.3