Your question has been submitted and is awaiting moderation.
I am building an API on a DNN 7 and and using the services from an external html page (which will become a phone app eventually) and have come across a small hiccup.
It would seem I am unable to presist my logged in state across services calls.
here is what I am experiencing.
I have a method which logs in the user, within this method I can access userInfo and return it to the UI.
Next I make another call to a separate service which uses userInfo.userID within it. Now userID is -1.
I assume this is because I am missing session related cookies that dnn would normally be able to pass..
Does anyone know how to achieve what I am trying to do?
On a note, I saw on the DNN 7 quick start guide the following.. it sounds like what I might be looking for but I dont get how it works.
"HttpRequestMessageExtensions Provides additional methods to get the Tab and Module Ids included in a request. The tab and module id formats can be extended beyond the default header and query string locations by implementing the ITabAndModuleInfoProvider interface.
Also provides safe access to the HttpContext of a request. Wherever possible HttpContext should be avoided in services, however it is not always possible in those rare cases this method should be used. This method is essential when writing an Asynchronous service as the HttpContext will not be available from HttpContextSource.Current, or HttpContext.Current. There is also a GetIPAddress method available to cover the single most common reason for accessing the HttpContext."