Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...RequestVerificationToken in API?RequestVerificationToken in API?
Previous
 
Next
New Post
8/11/2012 12:56 PM
 

Hello,

I was trying to write a way for one of my modules to post to a web service built in the 6.2 framework. But, I kept getting an unauthorized (401) response. I think this is because I need to send the request verification token along with my posted data. However, there's no way to generate it through the API - at least not that I can find.

In DotNetNuke.Framework.ServicesFramework, there is a private function that creates an HTML helper from MVC to get the token, but, because it's private, it only works through a process that creates a block to embed in page as a hidden field. I don't think this works for creating a webrequest in code.

So, first, does anybody know if I'm missing something - is there some way to get the RequestVerificationToken? Second, if not, can you make a simple function or property that is exposed through the API that will report the current token? From what I can tell, it would be easy enough to do in that ServicesFramework class... Everything is there, it's just not exposed.

Thanks,

Mike

 
New Post
8/11/2012 1:25 PM
 

I'm no expert, but I have a WCF service that's called from JS on the page. I wanted security too.

The authentication cookie will come in automatically - it's the same host domain. I needed the service to have this attribute.

AspNetCompatibilityRequirements(RequirementsMode:=AspNetCompatibilityRequirementsMode.Required)

From memory that forces WCF to use the same pipeline as ASP.Net. The authentication cookie is picked up and used automatically. 

Membership.GetUser(), the bit I needed, then works automatically.

HTH.


Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
10/30/2012 4:51 PM
 

I am doing the same thing and it's working.  I was thinking of extending this to support FaceBook authentation provider to authenticate with REST with Facebook.  Any thoughts?


 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...RequestVerificationToken in API?RequestVerificationToken in API?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out