Base solution for your next web application
Open Closed

Difficulties in using MVC views in Mobile Web views #11404


User avatar
0
tanzil6 created

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)
  • User Avatar
    0
    ismcagdas created
    Support Team

    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.

  • User Avatar
    0
    tanzil6 created

    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)?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @tanzil6

    You can see it when you run the MVC app in the browser console. It is standard ASP.NET Core Identity cookie.