restored success/error redirects

This commit is contained in:
Sebastian Stenzel
2022-04-28 12:59:27 +02:00
parent 9f0e269baf
commit d4b3eff42f
2 changed files with 3 additions and 2 deletions

View File

@@ -143,7 +143,7 @@
<dependency>
<groupId>io.github.coffeelibs</groupId>
<artifactId>tiny-oauth2-client</artifactId>
<version>0.1.1</version>
<version>0.2.0</version>
</dependency>
<dependency>
<groupId>com.auth0</groupId>

View File

@@ -28,8 +28,9 @@ class AuthFlowTask extends Task<String> {
@Override
protected String call() throws IOException, InterruptedException {
// TODO configure redirectURIs with deviceId from authFlowContext
var response = AuthFlow.asClient(hubConfig.clientId) //
.withSuccessRedirect(URI.create(hubConfig.authSuccessUrl + "&device=" + authFlowContext.deviceId())) //
.withErrorRedirect(URI.create(hubConfig.authErrorUrl + "&device=" + authFlowContext.deviceId())) //
.authorize(URI.create(hubConfig.authEndpoint), redirectUriConsumer) //
.getAccessToken(URI.create(hubConfig.tokenEndpoint));
var json = JsonParser.parseString(response);