Skip to content

Commit cb038bf

Browse files
committed
added the dpop support in the token renew flow
1 parent 0663272 commit cb038bf

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,8 +821,16 @@ public class AuthenticationAPIClient @VisibleForTesting(otherwise = VisibleForTe
821821
val credentialsAdapter = GsonAdapter(
822822
Credentials::class.java, gson
823823
)
824-
return factory.post(url.toString(), credentialsAdapter)
824+
val request = factory.post(url.toString(), credentialsAdapter)
825825
.addParameters(parameters)
826+
try {
827+
DPoPProvider.generateProof(request.getUrl(), request.getHttpMethod().toString())?.let {
828+
request.addHeader(DPoPProvider.DPOP_HEADER, it)
829+
}
830+
} catch (exception: DPoPException) {
831+
Log.e(TAG, "Error generating DPoP proof: ${exception.stackTraceToString()}")
832+
}
833+
return request
826834
}
827835

828836
/**

0 commit comments

Comments
 (0)