Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ntn0de's avatar

Api to web routes

I have a backend for my flutter mobile application for which I m fetching data from api routes. I need to fetch a certain webview from my backend which needs to be handled with authorisation headers from the mobile. So that the user need not to re enter username and password.

0 likes
6 replies
ntn0de's avatar

@prasadchinwal5 In my application I have been fetching data through API calls. Now for some specific screen, I need to have a webview.

I have beem fetching data with token based authentication whose routes were in api.php.

But guess I need to have a route in web.php for that webview. I need a way to fetch that route without the user having to relogin.

CorvS's avatar
CorvS
Best Answer
Level 27

@ntn0de You could either work with signed URLs, if that matches your case or create and work with some sort of "one time access token" (like Laravel's password reset does).

Be careful what the user is allowed to do tho and maybe force a login if he/she tries to access other areas.

ntn0de's avatar

@nimrod I tried the signed URLs The content will be blank in incognito (which means will be blank in mobile webview as well)

But in a browser if a user is logged in, shows content.

CorvS's avatar

@ntn0de That doesn't sound right, what does your signed route/endpoint look like?

ntn0de's avatar

Hi @nimrod Thanks the signed url worked just fine for the function I'd like to implement. The page was blank because the template was wrapped with @ can admin.

I m also looking for a way to just authenticate the user inside the web and interact with other links as well.

Please or to participate in this conversation.