fix(oauth): derive token URL from configured server instead of hardcoded Teclib instance - #436
fix(oauth): derive token URL from configured server instead of hardcoded Teclib instance#436Yago-Otero wants to merge 4 commits into
Conversation
|
Hi @Yago-Otero, Thank you for your interest in my PR. I’ve directly integrated the latest commit into the original PR, so there is no need to maintain a separate one. We’re currently waiting for feedback from several testers before proceeding with the official release. I suggest closing this PR and continuing the work and discussion in the original one. Best regards, |
|
Hi @stonebuzz, Thanks for integrating the fix into #420 so quickly. Just to explain why I opened a separate PR: I couldn't push directly to your Since the change is already in #420, I'll close this one. Happy to help with testing if you need extra feedback. Best regards |
|
I'm always happy to receive feedback, so please don't hesitate to share your thoughts. Feel free to discuss it directly in the original PR so we can keep everything in one place. 😊 |
Why this PR exists
Bug Report & Fix: Hardcoded token URL breaks OAuth authentication flow
Summary
Fix Verified: Once the token URL is changed from a hardcoded string to a dynamic endpoint, the OAuth 2.0 authentication flow works 100% successfully, allowing the agent to authenticate and push the inventory to GLPI without any errors.
Description & Root Cause
When testing OAuth 2.0 (Client Credentials) authentication on the Android Agent against our custom GLPI server, the credential exchange failed systematically.
Upon inspecting the codebase, we found that the app was ignoring the user's configured server URL because of a hardcoded developer endpoint left in the authentication flow:
https://stanislaskita.fr35.glpi-network.cloud/api.php/tokenBecause of this leftover URL, the agent was sending token requests to that external server instead of the user's configured instance.
Solution Applied & Results
We removed the hardcoded string and made the token URL dynamic by calling
buildTokenURL().Code Change Overview: