We have a hybrid mobile app,
Some of the app screens are native and using web apis with bearer token and working great.
Then we have some screens where we use web view and display some of MVC web pages, we are passing the bearer token in the header which working fine in postman but in mobile webview it show login pop up after a few seconds.
what should be the proper way to use the MVC views inside mobile app webview with auth/Bearer token ?
The below screenshot is showing error that the user is not logged in.
3 Answer(s)
-
0
Hi @tanzil6
MVC app uses Cookie based authentication by default. So, I think this is expected. For MVC app, you can write a middleware which reads teh token and adds it to cookie.
-
0
Hello @ismcagdas
Can you elaborate it a little more, what is the cookie name and what will be its value structure, Is it something like (Bearer etc)?
-
0
Hi @tanzil6
You can see it when you run the MVC app in the browser console. It is standard ASP.NET Core Identity cookie.