From f00765b49432b48aa015e57d334424b4643d9044 Mon Sep 17 00:00:00 2001 From: Rajdeep Nanua Date: Wed, 18 Dec 2024 11:24:05 -0500 Subject: [PATCH] Don't follow redirects for OkHttp --- CHANGELOG.md | 3 +++ android/src/main/java/com/oktareactnative/HttpClientImpl.java | 1 + 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ab3602c..199ea0e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.17.0 +- Don't follow redirects for OkHttp. This fixes MFA issues when using classic Okta and session token login. + # 2.16.0 - Fix vulnerabilities and remove jsonpath-plus. Thanks to [vero1024](https://github.com/vero1024) for contribution in this release! diff --git a/android/src/main/java/com/oktareactnative/HttpClientImpl.java b/android/src/main/java/com/oktareactnative/HttpClientImpl.java index cc1fff90..a9131013 100644 --- a/android/src/main/java/com/oktareactnative/HttpClientImpl.java +++ b/android/src/main/java/com/oktareactnative/HttpClientImpl.java @@ -62,6 +62,7 @@ protected Request buildRequest(Uri uri, ConnectionParameters param) { sOkHttpClient = new OkHttpClient.Builder() .connectTimeout(connectTimeoutMs, TimeUnit.MILLISECONDS) .readTimeout(readTimeoutMs, TimeUnit.MILLISECONDS) + .followRedirects(false) .build(); } Request.Builder requestBuilder = new Request.Builder().url(uri.toString());