mirror of
https://github.com/bitwarden/android.git
synced 2026-03-09 03:33:36 -05:00
changing BaseURL in src/App/Utilities/ApiHttpClient.cs leads to network error #354
Closed
opened 2025-11-07 08:36:44 -06:00 by GiteaMirror
·
17 comments
No Branch/Tag Specified
main
crowdin-pull
PM-33266-crashlytics-bug
PM-32123/cookie-sync-error-message
PM-29861-update-overflow-content-description
PM-33227/clear-cookies-debug-button
update-agp
PM-26059-remove-cipher-key-encryption-flag
remove-remember-viewmodel
PM-29871-external-links
PM-29673/flight-recorder-export-header-info
renovate/lock-file-maintenance
sdlc/sdk-update
release/2026.3-rc48
PM-24380/flight-recorder-redact-hostname
release/2026.2-rc47
PM-32714/fallback-to-web-vault-host
pr-6572
PM-28834/setting-app-layout-horizonos
PM-26896-autofill-fix
vvolkgang/process-release-notes-v2
PM-26577-app-links-support
release/2026.2-rc46
release/2026.1-rc45
PM-30644/added-logs-for-debug
PM-30644/quicktile-nav-not-showing-migration
minor-gradle-updates
release/2026.1-rc42
release/2026.1-rc44
release/2026.1-rc43
PM-28834/set-landscape-on-horizonos-devices
context-rules
devclarity/update-code-review-command
PM-20026/force-ltr-passwords-and-codes
release/2025.12-rc41
cmcg/testCoverage
claude-skill/creating-feature-flags
PM-29014/talkback-support-for-passwords
release/2025.12-rc40
BRE-1305/publish_test
accept-user-certs
autofill-permissions
release/2025.11-rc39
PM-22479/check-all-certificates-validate-asset-links
release/2025.10-rc38
agalles/android-latest
optimize-test-workflows
tier2-test-sharding
retro-agent
PM-27001/skip-account-selection-only-one-exists-cxp
release/2025.10-rc37
agalles/test-1118
release/2025.10-rc36
PM-20593-token-refresh
QA-1126b/adding-native-sanity-test
release/2025.9-rc35
pm-25933/sdk-update-password
release/2025.9-rc34
release/2025.8-rc33
agalles/20250821-release
debug-release-issues
pm-24249-allow-automated-prs-for-sdk-updates
release/2025.8-rc32
release/WORKFLOW-TEST-2025.8-rc28
agalles/20250807release
release/2025.07-rc25
release/hotfix-v2025.7.0-bwa
pm-23311/export-vault-policy-bypass
release/2025.07-rc24
authenticator-pm-sync-flags-issue
ps/implement-sdk-repository-example
release/hotfix-v2025.6.0-bwpm
release/2025.06-rc21
agalles/automate-android-fastlane-patch
release/2025.05-rc20
release/2025.04-rc19
languages/basque
release/2025.03-rc19
update-readme
qrcode/feature
innovation/archive/pm-19153-archive-items
qrcode/2-ui-fields
qrcode/1-page
hold-on-biometric-prompt-alternative
release-notes-process
release/2025.02-rc16
bwa-monorepo
PM-8223/new-device-verification-ux-improvements
pm-18451/exempt-from-policies
test-bwa
cs-workaround-linked-0-copy
release/2025.01-rc15
release/2025.01-rc14
release/2024.12-rc13
pm-16670/sync-leave-notice
821
PM-16695/backport-lean-more-new-device-verification
km/15084-testing
release/hotfix-v2024.11.7
release/2024.11-rc1
pm-11304/collection-add-item-button
PM-14241/disabling-logs-app-crash
poc/offline-editing
new-version-calc
pm-11649/expired-link-services
pm-6702/add-feature-flag
pm-6702/email-verification-feature
pm-9933/marketing-copy-update
pm-6702/registration-flows
update-templates
pm-6701/email-verification-selfhost-registration
v2026.2.1-bwpm
v2026.2.1-bwa
v2026.2.0-bwpm
v2026.2.0-bwa
v2026.1.1-bwa
v2026.1.1-bwpm
temp-test
v2026.1.0-bwpm
v2026.1.0-bwa
v2025.12.1-bwa
v2025.12.1-bwpm
v2025.12.0-bwa
v2025.12.0-bwpm
v2025.11.1-bwpm
v2025.11.1-bwa
v2025.11.0-bwpm
v2025.11.0-bwa
v2025.10.1-bwa
v2025.10.1-bwpm
v2025.10.0-bwa
v2025.10.0-bwpm
v2025.9.1-bwa
v2025.9.1-bwpm
v2025.9.0-bwa
v2025.9.0-bwpm
v2025.8.1-bwa
v2025.8.1-bwpm
v2025.8.0-bwa
v2025.8.0-bwpm
v2025.7.2-bwa
v2025.7.2-bwpm
v2025.7.1-bwa
v2025.7.1-bwpm
v2025.7.0-bwa
v2025.7.0-bwpm
v2025.6.1-bwpm
v2025.6.0-bwa
v2025.6.0-bwpm
v2025.1.0-bwa
v2025.5.0-bwa
v2025.5.0-bwpm
v2025.5.999
2025.4.0
v2025.4.0
untagged-4731eaadac73f3dfbbb8
v2025.3.0
v2025.2.0
untagged-815a165c5d70ffe75bc7
v2025.1.2
v2025.1.1
v2025.1.0
v2024.12.0
untagged-5a76b6392a4c8998c63a
v2024.11.7
v2024.11.6
v2024.11.5
v2024.11.4
v2024.11.3
v2024.11.2
v2024.11.1
v2024.11.0
v2024.10.2
v2024.10.1
v2024.10.0
v2024.9.0
v2024.8.1
v2024.8.0
v2024.7.3
v2024.7.2
v2024.7.1
v2024.7.0
v2024.6.1
v2024.6.0
v2024.5.1
v2024.4.1
v2024.4.2
v2024.4.0
v2024.3.3
v2024.3.1
v2024.3.0
v2024.2.1
v2024.2.0
v2024.1.1
v2024.1.0
v2023.12.0
v2023.10.0
v2023.9.2
maui-single-project-android
v2023.9.1
v2023.9.0
v2023.8.0
v2023.7.0
v2023.5.0
v2023.4.0
v2023.3.2
v2023.3.1
v2023.3.0
v2023.2.0
v2023.1.0
v2022.11.0
v2022.10.0
v2022.9.1
v2022.9.0
v2022.8.0
v2022.6.2
v2022.6.1
v2022.6.0
v2022.05.0
v2.18.0
v2.17.0
v2.16.4
v2.16.3
v2.16.2
v2.16.1
v2.15.0
v2.14.2
v2.14.1
v2.14.0
v2.13.0
v2.12.0
v2.11.3
v2.11.2
v2.11.1
v2.11.0
v2.10.0
v2.9.1
v2.9.0
v2.8.2
v2.8.1
v2.8.0
v2.7.2
v2.7.0
v2.6.1
v2.6.0
v2.5.6
v.2.5.5
v2.5.5
v2.5.4
v2.5.3
v2.5.2
v2.5.1
v2.5.0
v2.4.3
v2.4.2
v2.4.1
v2.4.0
v2.3.1
v2.3.0
v2.2.8
v2.2.7
v2.2.6
v2.2.2
v2.2.1
v2.2.0
v2.1.2
v2.1.0
v2.0.6
v2.0.5
v2.0.4
v2.0.3
v2.0.2
v2.0.1
v2.0.0
v1.22.1
v1.22.0
v1.21.0
v1.20.0
v1.19.0
v1.18.1
v1.18.0
v1.17.0
v1.16.0
v1.15.2
v1.15.1
v1.15.0
v1.14.4
v1.14.1
v1.14.0
v1.13.0
v1.12.2
v1.12.1
v1.12.0
v1.11.1
v1.11.0
v1.10.0
v1.9.0
v1.8.1
v1.8.0
v1.7.0
v1.6.5
v1.6.1
v1.6.0
v1.5.1
v1.5.0
v1.4.4
v1.4.3
v1.4.0
v1.3.0
v1.2.1
v1.2.0
v1.1.0
v1.0.0
v0.0.6
v0.0.5
v0.0.4
v0.0.3
v0.0.2
v0.0.1
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/android#354
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pdarcos on GitHub (Mar 11, 2019).
As described in the title, I just compiled the app for Android and followed the instructions in the wiki to change the BaseUrl to my self-hosted bitwarden_rs installation.
Specifically I changed
6d11921f45/src/App/Utilities/ApiHttpClient.cs (L40)to BaseAddress = new Uri("https://my.selfhosted.com"); // Production
and
in
6d11921f45/src/App/Utilities/IdentityHttpClient.cs (L40)to BaseAddress = new Uri("https://my.selfhosted.com"); // Production
After compiling and running it on my android tablet (8.1) I always get the error message "An error has occurred: There is a problem connecting to the server"
I tried in the app going into Settings and changing the Server URL there under self-hosted environment to https://my.selfhosted.com and it works fine as expected.
Am I doing something wrong? How can I set the BaseURL without having to open the app, go to settings and type it in there?
Thanks
@pdarcos commented on GitHub (Mar 11, 2019):
Any clues? Debug logs don't show the nature of the error. I know it's not an issue with my let's encrypt certificates since I'm passing the fullchain.pem and can login to the web vault from the tablet using firefox browser. Also, checking with https://www.digicert.com/help/ shows my certs are all fine.
So if it isn't a certificate issue (as I read in many closed posts) I must be doing something wrong when trying to set the BaseAddress as described above.
Is there another way to permanently set the self-hosted URL as BaseAddress in the code?
Thanks
@kspearrin commented on GitHub (Mar 11, 2019):
Without knowing what your server's URL is, I'm not sure. Can't you just change from login settings page? Why are you needing to compile locally?
@pdarcos commented on GitHub (Mar 11, 2019):
Thanks for the reply @kspearrin
I'll email you the URL since I don't want to expose it in a public place.
The reason I want to compile locally is to be able to have the app go directly to my self-hosted server without having to fill out anything. I was able to do this in the past without much issue but this time I'm getting that unhelpful error message. Not sure what changed since I last compiled a working version last summer.
I'll email you the URL now using your website form
@pdarcos commented on GitHub (Mar 11, 2019):
Just emailed you the URL
@kspearrin commented on GitHub (Mar 11, 2019):
I am not sure how the bitwarden_rs server works, but normally you just need to configure the API and identity server URLs. Try debugging the mobile app to see why it is failing.
@pdarcos commented on GitHub (Mar 12, 2019):
The bitwarden_rs server works fine with the app if I set the Server URL in the login settings page, so I don't think there's any compatibility problem. What I don't understand is why I get the connection error message if I set the BaseAddress URL to my server URL.
Unfortunately the debug logs don't really show anything.
[Mono] DllImport searching in: '__Internal' ('(null)').
[Mono] Searching for 'java_interop_jnienv_call_long_method_a'.
[Mono] Probing 'java_interop_jnienv_call_long_method_a'.
[Mono] Found as 'java_interop_jnienv_call_long_method_a'.
[Mono] Assembly Ref addref Xamarin.Forms.Platform.Android[0x6a3d16a0] -> Xamarin.Android.Support.Compat[0x6a3d0fe0]: 5
[Mono] Assembly Ref addref Xamarin.Android.Support.Compat[0x6a3d0fe0] -> Java.Interop[0x6a3d1c40]: 9
[art] JNI RegisterNativeMethods: attempt to register 0 native methods for md51558244f76c53b6aeda52c8a337f2c37.TableViewRenderer
[art] JNI RegisterNativeMethods: attempt to register 0 native methods for md50a3fb0d815bba0cfe9c20906cbbc65da.ExtendedTableViewRenderer
[art] JNI RegisterNativeMethods: attempt to register 0 native methods for md51558244f76c53b6aeda52c8a337f2c37.BaseCellView
[art] JNI RegisterNativeMethods: attempt to register 0 native methods for md51558244f76c53b6aeda52c8a337f2c37.TextCellRenderer_TextCellView
[Mono] DllImport searching in: '__Internal' ('(null)').
[Mono] Searching for 'java_interop_jnienv_set_float_field'.
[Mono] Probing 'java_interop_jnienv_set_float_field'.
[Mono] Found as 'java_interop_jnienv_set_float_field'.
[art] JNI RegisterNativeMethods: attempt to register 0 native methods for md51558244f76c53b6aeda52c8a337f2c37.CellRenderer_RendererHolder
[art] JNI RegisterNativeMethods: attempt to register 0 native methods for md50a3fb0d815bba0cfe9c20906cbbc65da.ExtendedEntryRenderer
[Mono] DllImport searching in: '__Internal' ('(null)').
[Mono] Searching for 'java_interop_jnienv_call_static_long_method_a'.
[Mono] Probing 'java_interop_jnienv_call_static_long_method_a'.
[Mono] Found as 'java_interop_jnienv_call_static_long_method_a'.
[Choreographer] Skipped 38 frames! The application may be doing too much work on its main thread.
[View] requestLayout() improperly called by md51558244f76c53b6aeda52c8a337f2c37.ScrollViewContainer{e5fd2a6 V.E...... ......ID 0,0-720,1120} during layout: running second layout pass
[View] requestLayout() improperly called by md58432a647068b097f9637064b8985a5e0.NavigationPageRenderer{ff1e707 V.E...... ........ 0,0-720,1232 #9} during second layout pass: posting in next frame
Thread finished: #3
Thread started: #9
Thread finished: #7
[Mono] Assembly Ref addref Mono.Android[0x6a3d1be0] -> System.Net.Http[0x573ad480]: 4
[Mono] Assembly Ref addref BitwardenAndroid[0x6a3cff60] -> System.Net.Http[0x573ad480]: 5
[Mono] Assembly Ref addref Mono.Android[0x6a3d1be0] -> System[0x56c77840]: 18
[Mono] Assembly Ref addref PCLCrypto[0x6a3d0500] -> Validation[0x6a3d0da0]: 2
[Mono] Unloading image System.Globalization.dll [0x5a90ab00].
[Mono] Image addref System.Globalization[0x573ae380] -> System.Globalization.dll[0x57193100]: 5
[Mono] Config attempting to parse: 'System.Globalization.dll.config'.
[Mono] Config attempting to parse: '/Users/builder/jenkins/workspace/xamarin-android-d15-9/xamarin-android/external/mono/sdks/out/android-armeabi-v7a-release/etc/mono/assemblies/System.Globalization/System.Globalization.config'.
[Mono] Assembly Ref addref Validation[0x6a3d0da0] -> System.Globalization[0x56c79fa0]: 3
[Mono] Assembly Ref addref netstandard[0x56c77720] -> System.Runtime.Serialization[0x56c78ec0]: 4
[Mono] Image addref System.Numerics[0x5a1bc880] -> System.Numerics.dll[0x5a90ab00]: 2
[Mono] Prepared to set up assembly 'System.Numerics' (System.Numerics.dll)
[Mono] Assembly System.Numerics[0x5a1bc880] added to domain RootDomain, ref_count=1
[Mono] AOT: image 'System.Numerics.dll.so' not found: dlopen failed: library "/data/app/com.x8bit.bitwarden-1/lib/arm/libaot-System.Numerics.dll.so" not found
[Mono] AOT: image '/Users/builder/jenkins/workspace/xamarin-android-d15-9/xamarin-android/external/mono/sdks/out/android-armeabi-v7a-release/lib/mono/aot-cache/arm/System.Numerics.dll.so' not found: dlopen failed: library "/data/app/com.x8bit.bitwarden-1/lib/arm/libaot-System.Numerics.dll.so" not found
[Mono] Config attempting to parse: 'System.Numerics.dll.config'.
[Mono] Config attempting to parse: '/Users/builder/jenkins/workspace/xamarin-android-d15-9/xamarin-android/external/mono/sdks/out/android-armeabi-v7a-release/etc/mono/assemblies/System.Numerics/System.Numerics.config'.
[Mono] Assembly Ref addref netstandard[0x56c77720] -> System.Numerics[0x5a1bc880]: 2
[Mono] Assembly Ref addref System.Numerics[0x5a1bc880] -> mscorlib[0x6a3cfea0]: 73
Loaded assembly: System.Numerics.dll [External]
[Mono] Image addref System.Data[0x5a57fa00] -> System.Data.dll[0x579d5500]: 2
[Mono] Prepared to set up assembly 'System.Data' (System.Data.dll)
[Mono] Assembly System.Data[0x5a57fa00] added to domain RootDomain, ref_count=1
[Mono] AOT: image 'System.Data.dll.so' not found: dlopen failed: library "/data/app/com.x8bit.bitwarden-1/lib/arm/libaot-System.Data.dll.so" not found
[Mono] AOT: image '/Users/builder/jenkins/workspace/xamarin-android-d15-9/xamarin-android/external/mono/sdks/out/android-armeabi-v7a-release/lib/mono/aot-cache/arm/System.Data.dll.so' not found: dlopen failed: library "/data/app/com.x8bit.bitwarden-1/lib/arm/libaot-System.Data.dll.so" not found
[Mono] Config attempting to parse: 'System.Data.dll.config'.
[Mono] Config attempting to parse: '/Users/builder/jenkins/workspace/xamarin-android-d15-9/xamarin-android/external/mono/sdks/out/android-armeabi-v7a-release/etc/mono/assemblies/System.Data/System.Data.config'.
[Mono] Assembly Ref addref netstandard[0x56c77720] -> System.Data[0x5a57fa00]: 2
[Mono] Assembly Ref addref System.Data[0x5a57fa00] -> mscorlib[0x6a3cfea0]: 74
[Mono] Assembly Ref addref System.Data[0x5a57fa00] -> System.Xml[0x59d96b40]: 6
Loaded assembly: System.Data.dll [External]
[Mono] Assembly Ref addref System.Data[0x5a57fa00] -> System[0x56c77840]: 19
[Mono] Assembly Ref addref System.Data[0x5a57fa00] -> System.Core[0x6a3d1dc0]: 9
[System] ClassLoader referenced unknown path: /system/framework/tcmclient.jar
[Choreographer] Skipped 90 frames! The application may be doing too much work on its main thread.
Thread started: #10
Thread started: #11
Thread started: #12
[Mono] Assembly Ref addref BitwardenAndroid[0x6a3cff60] -> BouncyCastle.Crypto[0x6a3cffc0]: 2
Thread finished: #12
and after trying to login again:
A OnStart
[Mono] DllImport searching in: 'e_sqlite3' ('./libe_sqlite3.so').
[Mono] Searching for 'sqlite3_column_int'.
OnStart
A OnResume
[View] requestLayout() improperly called by md51558244f76c53b6aeda52c8a337f2c37.ScrollViewContainer{82e9b16 V.E...... ......ID 0,0-720,1232} during layout: running second layout pass
[View] requestLayout() improperly called by md58432a647068b097f9637064b8985a5e0.NavigationPageRenderer{7299589 V.E...... ........ 0,0-720,1232 #1f} during second layout pass: posting in next frame
[View] requestLayout() improperly called by md51558244f76c53b6aeda52c8a337f2c37.ScrollViewContainer{8fbd588 V.E...... ......ID 0,0-720,1120} during layout: running second layout pass
[View] requestLayout() improperly called by md58432a647068b097f9637064b8985a5e0.NavigationPageRenderer{a6fb77d V.E...... ........ 0,0-720,1232 #27} during second layout pass: posting in next frame
Thread finished: #13
Thread started: #17
Thread finished: #15
Thread finished: #14
Thread started: #18
Thread started: #19
Thread started: #20
Thread finished: #18
I was hoping the debug logs would show some useful info. Checking server side I see that the attempted login never even reaches the server, so I would suspect some problem on the client.
Any clues?
Thanks
@kspearrin commented on GitHub (Mar 13, 2019):
Try setting breakpoints. For example, here: https://github.com/bitwarden/mobile/blob/master/src/App/Repositories/ConnectApiRepository.cs#L52 or here https://github.com/bitwarden/mobile/blob/master/src/App/Repositories/ConnectApiRepository.cs#L73
@pdarcos commented on GitHub (Mar 14, 2019):
Thanks Kyle.
I've done as you said and here's the results from both breakpoints
L52 is here https://paste.ee/d/Evc19/0
and L73 is here https://paste.ee/d/I3UGF
Any clues?
@kspearrin commented on GitHub (Mar 14, 2019):
What is the exception being caught on 73? Might need to change it to
catch (Exception e)so that you can inspect the exception@pdarcos commented on GitHub (Mar 14, 2019):
Thanks for your help @kspearrin
I caught some exceptions relating to Newtonsoft.Json which could be the cause of the problem. It seems this nougat package is having problems parsing the URL I inserted for my self-hosted server, which then leads it to fail later when trying to connect.
Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 2, position 12.
at Newtonsoft.Json.JsonTextReader.ParseValue () [0x002b3] in :0
at Newtonsoft.Json.JsonTextReader.Read () [0x0004c] in :0
at Newtonsoft.Json.Linq.JObject.Load (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Linq.JsonLoadSettings settings) [0x00013] in :0
at Newtonsoft.Json.Linq.JObject.Parse (System.String json, Newtonsoft.Json.Linq.JsonLoadSettings settings) [0x0000c] in :0
at Newtonsoft.Json.Linq.JObject.Parse (System.String json) [0x00000] in :0
at Bit.App.Repositories.BaseApiRepository+d__24.MoveNext () [0x00102] in /mobile/src/App/Repositories/BaseApiRepository.cs:157
and also
Bit.App.Repositories.BaseApiRepository.d__22<Bit.App.Models.Api.HandleErrorAsync() in /mobile/src/App/Repositories/BaseApiRepository.cs:122
Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 2, position 12.
at Newtonsoft.Json.JsonTextReader.ParseValue () [0x002b3] in :0
at Newtonsoft.Json.JsonTextReader.Read () [0x0004c] in :0
at Newtonsoft.Json.Linq.JObject.Load (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Linq.JsonLoadSettings settings) [0x00013] in :0
at Newtonsoft.Json.Linq.JObject.Parse (System.String json, Newtonsoft.Json.Linq.JsonLoadSettings settings) [0x0000c] in :0
at Newtonsoft.Json.Linq.JObject.Parse (System.String json) [0x00000] in :0
at Bit.App.Repositories.BaseApiRepository+d__24.MoveNext () [0x00102] in /mobile/src/App/Repositories/BaseApiRepository.cs:157
at Bit.App.Repositories.BaseApiRepository+d__22`1[T].MoveNext () [0x00038] in /mobile/src/App/Repositories/BaseApiRepository.cs:122
and
Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 2, position 12.
at Newtonsoft.Json.JsonTextReader.ParseValue () [0x002b3] in :0
at Newtonsoft.Json.JsonTextReader.Read () [0x0004c] in :0
at Newtonsoft.Json.Linq.JObject.Load (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Linq.JsonLoadSettings settings) [0x00013] in :0
at Newtonsoft.Json.Linq.JObject.Parse (System.String json, Newtonsoft.Json.Linq.JsonLoadSettings settings) [0x0000c] in :0
at Newtonsoft.Json.Linq.JObject.Parse (System.String json) [0x00000] in :0
at Bit.App.Repositories.ConnectApiRepository+d__3.MoveNext () [0x0023a] in /mobile/src/App/Repositories/ConnectApiRepository.cs:52
Bit.App.Repositories.ConnectApiRepository.PostTokenAsync() in /mobile/src/App/Repositories/ConnectApiRepository.cs:52
Any idea how to solve this?
Thanks
@kspearrin commented on GitHub (Mar 14, 2019):
Why is it having problems parsing your URL? What's non-standard about it?
@pdarcos commented on GitHub (Mar 14, 2019):
That’s what I’d like to know too.
Nothing special about the URL. It’s a standard one with .io TLD
And the fact it works fine when I change it manually in the login settings section is even more baffling.
Sent from my mobile device
@pdarcos commented on GitHub (Mar 15, 2019):
This seems like it maybe related
https://github.com/ngx-translate/core/issues/649
@pdarcos commented on GitHub (Mar 15, 2019):
Hi @kspearrin
Finally was able to dig deeper and found out the problem.
The problem is that somewhere your code is adding an extra / at the end of the BaseAddress so it then has a double // in the address which obviously fails (see below)
{Method: POST, RequestUri: 'https://my.domain.com//connect/token', Version: 1.1, Content: System.Net.Http.FormUrlEncodedContent, Headers: { Device-Type: 0 Accept: application/json Content-Type: application/x-www-form-urlencoded Content-Length: 274 }}
Now I'm 100% positive that in BaseAddress I've set the URL without the trailing / so somewhere it is being added by mistake.
Any idea where this is happening?
Cheers
@kspearrin commented on GitHub (Mar 16, 2019):
probably in the repositories themselves. that connect call happens in the ConnectApiRepository that I linked above.
@pdarcos commented on GitHub (Mar 18, 2019):
That's what I thought originally but no matter what I end up putting in here it always gives me the POST with the BaseURL and the double forward slash which always leads to the connection error.
RequestUri = new Uri(string.Concat(client.BaseAddress, "/connect/token")),
It seems almost as if VS is ignoring my changes even though I clean and build from scratch with different strings in RequestUri but none of them seem to be used.
Very confused as to why hardcoding something like this doesn't work:
RequestUri = new Uri("https://my.domain.com/connect/token"),
Any ideas?
@pdarcos commented on GitHub (Mar 26, 2019):
Just had to adjust the paths and now it works.