From e49a53aad413c920b8f63743258da1382fc9131e Mon Sep 17 00:00:00 2001 From: Amanpal Singh <87360222+aman-alfresco@users.noreply.github.com> Date: Tue, 17 Dec 2024 12:07:43 +0530 Subject: [PATCH] fixed issue (#88) --- auth/src/main/java/com/alfresco/auth/DiscoveryService.kt | 2 +- .../src/main/java/com/alfresco/auth/pkce/PkceAuthService.kt | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/auth/src/main/java/com/alfresco/auth/DiscoveryService.kt b/auth/src/main/java/com/alfresco/auth/DiscoveryService.kt index 709147f..72d63a3 100644 --- a/auth/src/main/java/com/alfresco/auth/DiscoveryService.kt +++ b/auth/src/main/java/com/alfresco/auth/DiscoveryService.kt @@ -137,7 +137,7 @@ class DiscoveryService( */ fun contentServiceUrl( endpoint: String, - authType: AuthTypeProvider = AuthTypeProvider.NONE + authType: AuthTypeProvider = AuthTypeProvider.NONE, ): Uri = PkceAuthService.endpointWith(endpoint, authConfig) .buildUpon() diff --git a/auth/src/main/java/com/alfresco/auth/pkce/PkceAuthService.kt b/auth/src/main/java/com/alfresco/auth/pkce/PkceAuthService.kt index c31cf11..c98388c 100644 --- a/auth/src/main/java/com/alfresco/auth/pkce/PkceAuthService.kt +++ b/auth/src/main/java/com/alfresco/auth/pkce/PkceAuthService.kt @@ -163,11 +163,10 @@ internal class PkceAuthService(context: Context, authState: AuthState?, authConf authState.get().clientAuthentication } - suspendCancellableCoroutine { authService.performTokenRequest( authorizationResponse.createTokenExchangeRequest(), - clientAuth + clientAuth, ) { response: TokenResponse?, ex: AuthorizationException? -> authState.get().update(response, ex) @@ -257,8 +256,7 @@ internal class PkceAuthService(context: Context, authState: AuthState?, authConf if (authConfig.authType == AuthTypeProvider.NEW_IDP) { authConfig.scope.takeIf { it.isNotEmpty() }?.let { builder.setScope(it) } authConfig.additionalParams.takeIf { it.isNotEmpty() }?.let { builder.setAdditionalParameters(it) } - } - + } return builder.build() }