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

HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...How to configure DotNetDuke.dll for my application?How to configure DotNetDuke.dll for my application?
Previous
 
Next
New Post
2/11/2014 9:38 AM
 
Thanks for the good info. This should steer me in the right direction.
 
New Post
2/11/2014 4:51 PM
 
 
New Post
2/11/2014 4:53 PM
 

 

 
New Post
2/11/2014 4:56 PM
 
Thanks for your quick response.  So, I've spent the last couple of days working on this.  I have successfully created a web services inside of my module and have used the DotNetNuke.dll to retrieve data.  My next step is to secure the service.  I've done this by creating a "ServiceUser" within DNN's security provider and have attempted to create a customvalidator.  

In my config file below (past the exception), in the wsHttpBinding section, if my configuration is set to:

<transport clientCredentialType="None" />

My unit test will run and return data, without calling the CustomValidator.  If I change the configuration to:

<transport clientCredentialType="Basic" />

I get the following error which looks like DNN is redirecting me to the login.  I've event added <location path="..."> but that doesn't seem to have an affect.  Not sure what I'm missing, but I think I'm pretty close.  Thanks in advance for your assistance.

  <location path="DotNetNuke/DesktopModules/DonorPreferences/SecurityService.svc">
    <system.web>
      <authorization>
        <allow users ="?" />
      </authorization>
    </system.web>
  </location>


System.ServiceModel.ProtocolException was unhandled by user code
  HResult=-2146233087
  Message=The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '<!DOCTYPE html>
<html  lang="en-US">
<head id="Head">
<!--************************************************************************************-->
<!-- DNN Platform - http://www.dnnsoftware.com                                        -->
<!-- Copyright (c) 2002-2014                                                          -->
<!-- by DNN Corporation                                                               -->
<!--**********************************************************************************-->
<title>
User Log In
</title><meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /><meta content="text/javascript" http-equiv="Content-Script-Type" /><meta content="text/css" http-equiv="Content-Style-Type" /><meta id="MetaKeywords" name="KEYWORDS" content=",DotNetNuke,DNN" /><meta id="MetaCopyright" name="COPYRIGHT" content="Copyright 2014 by DNN Corp" /><meta id="MetaGenerator" name="GENERATOR" content="DotNetNuke " /><meta id="MetaAuthor" name="AUTHOR" content="Test" /><meta name="RESO'.
  Source=mscorlib
  StackTrace:
    Server stack trace: 
       at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory`1 factory, WebException responseException, ChannelBinding channelBinding)
       at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Foundation.Security.Portal.WindowsService.DonorPreferencesSecurityService.ISecurityService.GetRoles()
       at Foundation.Security.Portal.WindowsService.DonorPreferencesSecurityService.SecurityServiceClient.GetRoles() in c:\Dev\Security\PortalSecuritySyncWindowsService\Trunk\PortalSecuritySyncWindowsService\Service References\DonorPreferencesSecurityService\Reference.cs:line 117
       at Foundation.Security.Portal.WindowsService.Process.<>c__DisplayClassd.<VerifyRole>b__c() in c:\Dev\Security\PortalSecuritySyncWindowsService\Trunk\PortalSecuritySyncWindowsService\Process.cs:line 82
       at Foundation.Common.ICommunicationObjectExtension.Execute[TResult](ICommunicationObject client, Func`1 code) in c:\Dev\Common\Common\Trunk\Common\ICommunicationObjectExtension.cs:line 101
       at Foundation.Security.Portal.WindowsService.Process.VerifyRole() in c:\Dev\Security\PortalSecuritySyncWindowsService\Trunk\PortalSecuritySyncWindowsService\Process.cs:line 82
       at UnitTestProject1.UnitTest1.VerifyRole() in c:\Dev\Security\PortalSecuritySyncWindowsService\Trunk\UnitTests\UnitTestProject1\UnitTest1.cs:line 26
  InnerException: 



  <system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="secureHttpBinding">
          <security mode="Transport">
            <message clientCredentialType="UserName" />
            <transport clientCredentialType="None" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>

    <behaviors>
      <serviceBehaviors>
        <behavior name="CustomValidator">
          <serviceCredentials>
            <userNameAuthentication userNamePasswordValidationMode="Custom"
               customUserNamePasswordValidatorType="Foundation.Portal.Modules.DonorPreferences.DnnValidator, DonorPreferences"/>
          </serviceCredentials>
          <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
        <behavior>
          <serviceMetadata httpsGetEnabled="true" httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    
    <services>
      <service name="Foundation.Portal.Modules.DonorPreferences.SecurityService" behaviorConfiguration="CustomValidator" >
        <endpoint address=""                  
                  binding="wsHttpBinding" 
                  bindingConfiguration="secureHttpBinding" 
                  contract="Foundation.Portal.Modules.DonorPreferences.ServiceContract.ISecurityService" />
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
      </service>
    </services>

    <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
  </system.serviceModel>
 
New Post
2/12/2014 9:14 AM
 

Well, I knew I was close.  After changing my config file to following settings, everything worked as expected.

<bindings>

<wsHttpBinding>

<binding name="secureHttpBinding">

<security mode="TransportWithMessageCredential">

<message clientCredentialType="UserName" />

</security>

</binding>

</wsHttpBinding>

</bindings>

 
Previous
 
Next
HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...How to configure DotNetDuke.dll for my application?How to configure DotNetDuke.dll for my application?


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