Replies: 4 comments 15 replies
-
You could make your app run on Generally i'd recommend spawning a seperate localhost server on the rust side that only handles the redirect request, for non rust users i created a small plugin here (still missing docs) https://github.com/FabianLars/tauri-plugin-oauth. I created the plugin initially to be able to run the oauth flow in the browser for oauth services that don't support deep links (because i really hate in-app logins as a user 😅), however it does work for in-app flows too, you'll just have to manually trigger an url change if you register a call to the localhost server. Edit: I forgot to give a straight answer to your last question: no it's not possible to use |
Beta Was this translation helpful? Give feedback.
-
Thanks for your answer @FabianLars. Other that stated before, I think my provider actually supports deeplinks (i.e. yourapp:// as a redirect URL). So I think I would need to intercept the webviews redirect to yourapp:// and do the token fetching via a implementation in rust. Once that was successful, I redirect back to the app, i.e. tauri://localhost I'm actually new to rust, so I tried to avoid to do the token fetching via rust. On windows I implemented the token fetching (a http POST request) in javascript. I think I could try to call my current javascript implementation from the rust interceptor. I tried to adapt the code from this example: I started the app in dev mode (npm run tauri dev) and simulated a redirect via following javascript in the dev console: I was expecting to see "Hello World" printed. But it did not. Do you have any idea why this is not called? Thanks in advance & My code in main.rs is similar to this:
I get the following error in the dev console: |
Beta Was this translation helpful? Give feedback.
-
Thanks for your support: npm run tauri info
[✔] Environment [-] Packages [-] App |
Beta Was this translation helpful? Give feedback.
-
I setup a new project. I took the example from your project: https://github.com/FabianLars/tauri-plugin-deep-link/blob/main/example/main.rs This works on my windows machine, but its not working on my linux machine. Browser console shows this (when trying to redirect to my-scheme://test.de): I added the dependency to the cargo.toml: and added this in the main.rs tauri_plugin_deep_link::prepare("com.test.deep-link-test"); and in the setup method of tauri builder: |
Beta Was this translation helpful? Give feedback.
-
I'm using oauth2 to authenticate users. This works fine with windows. My redirect URL is like https://tauri.localhost. Now I started to look into linux and found that the schema is tauri://localhost. But this redirect URL fails with following error:
"Redirection to URL with a scheme that is not HTTP(S)"
Is it possible to also have https://tauri.localhost on linux or is there any other solution to this problem?
Beta Was this translation helpful? Give feedback.
All reactions