| | |
| | | "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(); |
| | |
| | | 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(); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 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); |