How to get page contents or json content of a URL from a domain that's already authenticated? #11129
Unanswered
akhileshshastri-bpi
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm building a Tauri wrapper around an external webpage. What I'm trying to do is launch the webpage, which will take the user to the login screen. Then the user will login as usual. The user will then be redirected to the homepage. When the user comes back another day and opens the app again, they will still be authenticated. I assume this is because the cookie gets stored in local storage somewhere.
My question is, can I use that cookie to perform a request to an API that's under the same domain as the webpage I mentioned earlier? I want to fetch the json contents of the page. If not, perhaps I can encrypt and store the cookie in a secure location. In that case, how can I retrieve the cookie from local storage?
What I've tried:
fetch
from thehttp
plugin but it didn't use the cookie in local storage and instead fetched the content of the login screen.eval
method on the WebView window. But I couldn't figure out how to get the result of the eval as json.Any ideas?
Edit: I'm using Tauri v2
Beta Was this translation helpful? Give feedback.
All reactions