spawn server listening on localhost, used for oauth redirect_uri

This commit is contained in:
Sebastian Stenzel
2021-07-29 16:57:28 +02:00
parent b21ea61342
commit 7fabc6f52d
7 changed files with 222 additions and 19 deletions
@@ -0,0 +1,23 @@
package org.cryptomator.ui.keyloading.hub;
public class AuthReceiverTest {
static {
System.setProperty("LOGLEVEL", "INFO");
}
public static void main(String[] args) {
try (var receiver = AuthReceiver.start()) {
System.out.println("Waiting on " + receiver.getRedirectURL());
var token = receiver.receive();
System.out.println("SUCCESS: " + token);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
System.out.println("CANCELLED");
} catch (Exception e) {
System.out.println("ERROR");
e.printStackTrace();
}
}
}
+11
View File
@@ -0,0 +1,11 @@
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<root level="${LOGLEVEL:-debug}">
<appender-ref ref="STDOUT" />
</root>
</configuration>