Postby xidea » Fri Aug 12, 2016 9:11 am
Good news.
But, in the meantime, have you some hint about the inclusion of the app in a MVC app that manages the user authentication? For now, the app and the MVC website are two separate things, and there is perhaps a way to share js variables and functions by including the index.html in a MVC view by rendering his content using razor helpers.
By having the app page integrated in the rendered view, I could call js functions definded in the view via ExecuteJavascript, so I could share an authentication token that way. I need the app to be aware of what user is logged in the MVC site, so the app must know some way the User ID or some token representing the logged user in the server side WCF service context.
I think this is different from app-inside authenticating the user. It is precisely what I would not to do: the app is working inside the website context and must make use of it.
Sorry, my English is not so good to better explain the problem.
Now I think I can achieve this by writing a JS function in the MVC view markup (that includes the index.html markup) which returns info about the session, and call it from the app using ExecuteJavaScript. The app could then call the WCF service passing those info, and the WCF service could manage that info to retrieve user info and store his "logged in" state.
I've already tested the inclusion of the index.html in a ASP.NET MVC view with some success, not yet tried to put a js func in it and call from the app, but I think this is possible, as the view is rendered as an extended index.html, containing the function that I would call.
Thanks,
Flavio