Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Requires HTTPS
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Brian Wright  
View profile  
 More options Aug 2 2012, 5:14 pm
From: Brian Wright <brian.n.wri...@gmail.com>
Date: Thu, 2 Aug 2012 14:14:33 -0700 (PDT)
Local: Thurs, Aug 2 2012 5:14 pm
Subject: Requires HTTPS

This is similar to a very recent question, but different enough I have posted it separately.

I am trying to get a basic DNOA Client Credentials Scenario working.  Taking a major chunk from the article at (but changing it to work with the latest DNOA):

http://zamd.net/2012/05/04/claim-based-security-for-asp-net-web-apis-...

This is what I have:

Controller
--------

public class OAuthTokenController : Controller
{
        //
        // GET: /OAuthToken/

        public ActionResult Index()
        {
                var authorizationServer = new AuthorizationServer(
                        new OAuth2Issuer(
                                new X509Certificate2(Server.MapPath("~/Infrastructure/OAuth/localhost.pfx"), "a"),
                                new X509Certificate2(Server.MapPath("~/Infrastructure/OAuth/localhost.cer")),
                                null
                        )
                );

                OutgoingWebResponse resp = authorizationServer.HandleTokenRequest(Request);
                var response = MessagingUtilities.AsActionResult(resp);

                return response;
        }

}

Web.config
--------------
  <dotNetOpenAuth>
    <openid>
      <relyingParty>
        <security requireSsl="false">
        </security>
        <behaviors>
          <add type="DotNetOpenAuth.OpenId.RelyingParty.Behaviors.AXFetchAsSregTransform, DotNetOpenAuth" />
        </behaviors>
      </relyingParty>
    </openid>
    <messaging relaxSslRequirements="true">
      <untrustedWebRequest>
        <whitelistHosts>
          <add name="localhost" />
        </whitelistHosts>
      </untrustedWebRequest>
    </messaging>
    <reporting enabled="true" />
  </dotNetOpenAuth>

Client Code (Console app)
---------------

private static IAuthorizationState GetAccessToken()
{
        var authorizationServer = new AuthorizationServerDescription
        {
                TokenEndpoint = new Uri("http://localhost:20932/OAuthToken"),
                ProtocolVersion = ProtocolVersion.V20
        };
        var client = new WebServerClient(authorizationServer, "zamd", "test1243");

        var state = client.GetClientAccessToken(new[] { "http://localhost/" });
        return state;

}

The Problem
-----------
Whenever I call the GetClientAccessToken method, I get a ProtocolException with the message "This message can only be sent over HTTPS."

I have logging enabled using log4net on the webside, but nothing is logged when the client code makes this call (it does log if I hit it directly with a browser so I assume it is logging correctly)

How can I make it not require HTTPS?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew Arnott  
View profile  
 More options Aug 2 2012, 8:19 pm
From: Andrew Arnott <andrewarn...@gmail.com>
Date: Thu, 2 Aug 2012 17:19:28 -0700
Local: Thurs, Aug 2 2012 8:19 pm
Subject: Re: [dotnetopenauth] Requires HTTPS

Yes, this has come up recently.  And the answer was that the
<sectionGroups> in the web.config were incorrect.  You should check yours.
 They should look something like this:
<configSections>
 <section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHandler"
requirePermission="false"/>
 <sectionGroup name="dotNetOpenAuth"
type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection,
DotNetOpenAuth.Core">
<section name="openid" type="DotNetOpenAuth.Configuration.OpenIdElement,
DotNetOpenAuth.OpenId" requirePermission="false" allowLocation="true" />
 <section name="oauth" type="DotNetOpenAuth.Configuration.OAuthElement,
DotNetOpenAuth.OAuth" requirePermission="false" allowLocation="true" />
 <sectionGroup name="oauth2"
type="DotNetOpenAuth.Configuration.OAuth2SectionGroup,
DotNetOpenAuth.OAuth2">
<section name="authorizationServer"
type="DotNetOpenAuth.Configuration.OAuth2AuthorizationServerSection,
DotNetOpenAuth.OAuth2.AuthorizationServer" requirePermission="false"
allowLocation="true" />
 </sectionGroup>
<section name="messaging"
type="DotNetOpenAuth.Configuration.MessagingElement, DotNetOpenAuth.Core"
requirePermission="false" allowLocation="true" />
 <section name="reporting"
type="DotNetOpenAuth.Configuration.ReportingElement, DotNetOpenAuth.Core"
requirePermission="false" allowLocation="true" />
 </sectionGroup>
</configSections>

--
Andrew Arnott
"I [may] not agree with what you have to say, but I'll defend to the death
your right to say it." - S. G. Tallentyre

On Thu, Aug 2, 2012 at 2:14 PM, Brian Wright <brian.n.wri...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Wright  
View profile  
 More options Aug 3 2012, 11:55 am
From: Brian Wright <brian.n.wri...@gmail.com>
Date: Fri, 3 Aug 2012 08:55:33 -0700 (PDT)
Local: Fri, Aug 3 2012 11:55 am
Subject: Re: [dotnetopenauth] Requires HTTPS

Thanks so much for your help.  Unfortunately, it still gives me the same error.  Again, my logging shows nothing even though I believe it is hooked up right.

Is there nothing that I need to configure on the client side other than what I have shown in my code?

So the entire contents of my web.config on the server side are below:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    <section name="uri" type="System.Configuration.UriSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
                <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler" requirePermission="false" />
                <sectionGroup name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection, DotNetOpenAuth.Core">
                        <section name="openid" type="DotNetOpenAuth.Configuration.OpenIdElement, DotNetOpenAuth.OpenId" requirePermission="false" allowLocation="true" />
                        <section name="oauth" type="DotNetOpenAuth.Configuration.OAuthElement, DotNetOpenAuth.OAuth" requirePermission="false" allowLocation="true" />
                        <sectionGroup name="oauth2" type="DotNetOpenAuth.Configuration.OAuth2SectionGroup, DotNetOpenAuth.OAuth2">
                                <section name="authorizationServer" type="DotNetOpenAuth.Configuration.OAuth2AuthorizationServerSection, DotNetOpenAuth.OAuth2.AuthorizationServer" requirePermission="false" allowLocation="true" />
                        </sectionGroup>
                        <section name="messaging" type="DotNetOpenAuth.Configuration.MessagingElement, DotNetOpenAuth.Core" requirePermission="false" allowLocation="true" />
                        <section name="reporting" type="DotNetOpenAuth.Configuration.ReportingElement, DotNetOpenAuth.Core" requirePermission="false" allowLocation="true" />
                </sectionGroup>

        </configSections>
  <connectionStrings>
    <add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=****;Integrated Security=SSPI" />
    <add name="AuthorizationDB" connectionString="Data Source=****;Initial Catalog=****;Persist Security Info=True;User ID=****;Password=****" providerName="System.Data.SqlClient" />
  </connectionStrings>
  <appSettings>
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
    <add key="webpages:Version" value="2.0.0.0" />
    <add key="webpages:Enabled" value="false" />
    <add key="PreserveLoginUrl" value="true" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
  </appSettings>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
    <authentication mode="None" />
    <pages>
      <namespaces>
        <add namespace="System.Web.Helpers" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Optimization" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.WebPages" />
      </namespaces>
    </pages>
    <profile defaultProvider="DefaultProfileProvider">
      <providers>
        <add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
      </providers>
    </profile>
    <membership defaultProvider="DefaultMembershipProvider">
      <providers>
        <add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
      </providers>
    </membership>
    <roleManager defaultProvider="DefaultRoleProvider">
      <providers>
        <add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
      </providers>
    </roleManager>
    <sessionState mode="InProc" customProvider="DefaultSessionProvider">
      <providers>
        <add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" />
      </providers>
    </sessionState>
  </system.web>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
    <httpRedirect enabled="false" destination="http://****/****/" exactDestination="true" childOnly="false" />
    <handlers accessPolicy="Read, Script" />
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
    <legacyHMACWarning enabled="0" />
  </runtime>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="v11.0" />
      </parameters>
    </defaultConnectionFactory>
  </entityFramework>
  <uri>
    <!-- The uri section is necessary to turn on .NET 3.5 support for IDN (international domain names),
             which is necessary for OpenID urls with unicode characters in the domain/host name.
             It is also required to put the Uri class into RFC 3986 escaping mode, which OpenID and OAuth require. -->
    <idn enabled="All" />
    <iriParsing enabled="true" />
  </uri>
  <system.net>
    <defaultProxy enabled="true" />
    <settings>
      <!-- This setting causes .NET to check certificate revocation lists (CRL)
                             before trusting HTTPS certificates.  But this setting tends to not
                             be allowed in shared hosting environments. -->
      <!--<servicePointManager checkCertificateRevocationList="true"/>-->
    </settings>
  </system.net>
  <dotNetOpenAuth>
    <!-- This is an optional configuration section where aspects of dotnetopenauth can be customized. -->
    <!-- For a complete set of configuration options see http://www.dotnetopenauth.net/developers/code-snippets/configuration-... -->
    <openid>
      <relyingParty>
        <security requireSsl="false">
          <!-- Uncomment the trustedProviders tag if your relying party should only accept positive assertions from a closed set of OpenID Providers. -->
          <!--<trustedProviders rejectAssertionsFromUntrustedProviders="true">
                                                <add endpoint="https://www.google.com/accounts/o8/ud" />
                                        </trustedProviders>-->
        </security>
        <behaviors>
          <!-- The following OPTIONAL behavior allows RPs to use SREG only, but be compatible
                                             with OPs that use Attribute Exchange (in various formats). -->
          <add type="DotNetOpenAuth.OpenId.RelyingParty.Behaviors.AXFetchAsSregTransform, DotNetOpenAuth" />
        </behaviors>
      </relyingParty>
    </openid>
    <messaging relaxSslRequirements="true">
      <untrustedWebRequest>
        <whitelistHosts>
          <!-- Uncomment to enable communication with localhost (should generally not activate in production!) -->
          <add name="localhost" />
        </whitelistHosts>
      </untrustedWebRequest>
    </messaging>
    <!-- Allow DotNetOpenAuth to publish usage statistics to library authors to improve the library. -->
    <reporting enabled="true" />
  </dotNetOpenAuth>
        <!-- log4net is a 3rd party (free) logger library that dotnetopenid will use if present but does not require. -->
        <log4net>
                <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
                        <file value="RelyingParty.log" />
                        <appendToFile value="true" />
                        <rollingStyle value="Size" />
                        <maxSizeRollBackups value="10" />
                        <maximumFileSize value="100KB" />
                        <staticLogFileName value="true" />
                        <layout type="log4net.Layout.PatternLayout">
                                <conversionPattern value="%date (GMT%date{%z}) [%thread] %-5level %logger - %message%newline" />
                        </layout>
                </appender>
                <!-- Setup the root category, add the appenders and set the default level -->
                <root>
                        <level value="INFO" />
                        <appender-ref ref="RollingFileAppender" />
                </root>
                <!-- Specify the level for some specific categories -->
                <logger name="DotNetOpenAuth">
                        <level value="ALL" />
                </logger>
        </log4net>
</configuration>

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Steven Livingstone Pérez  
View profile  
 More options Aug 3 2012, 12:12 pm
From: Steven Livingstone Pérez <webl...@hotmail.com>
Date: Fri, 3 Aug 2012 16:12:16 +0000
Local: Fri, Aug 3 2012 12:12 pm
Subject: RE: [dotnetopenauth] Requires HTTPS

I recently extended the same example to get things working using the ROCP Grant (that example is actually an example of Client Credentials grant per my post on the blog).
Is the error you are still getting an issue with HTTPS?
Is so, make sure you relax SSL on both the Issuer website and the API website. This is ALL i have done to fix that particular issue.
There is nothing else i had to do at the client (other than call the correct endpoints).
/stevenhttp://livz.org

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Wright  
View profile  
 More options Aug 6 2012, 2:45 pm
From: Brian Wright <brian.n.wri...@gmail.com>
Date: Mon, 6 Aug 2012 11:45:41 -0700 (PDT)
Local: Mon, Aug 6 2012 2:45 pm
Subject: Re: [dotnetopenauth] Requires HTTPS

I am starting to feel silly about not resolving this when everyone makes it sound so simple.

In my case, the issuer and api websites are one and the same.. just different URLs and controllers.  I believe I have relaxed SSL to the best I know how (I posted my entire web.config earlier).

The client is just a console app and that is where I get the message the HTTP is required.  Nothing is logged on the server side when the client makes this call.  However, if I hit the server side directly via a browser I do get stuff logged.

I am obviously missing something and any help to get me in the right direction would be greatly appreciated.

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Steven Livingstone Pérez  
View profile  
 More options Aug 6 2012, 2:55 pm
From: Steven Livingstone Pérez <webl...@hotmail.com>
Date: Mon, 6 Aug 2012 18:55:01 +0000
Local: Mon, Aug 6 2012 2:55 pm
Subject: RE: [dotnetopenauth] Requires HTTPS

Brian - don't worry about sounding silly - it took a lot of effort for me to get it working too.
One step I would take is to put tracing on the server (/trace.axd) and analyse the request being made from the console app.
I do find it really odd that you are getting the "relax ssl" type message on the request though as AFAIK that config is the only place it can be set.
Would you be able to zip up your entire solution and fire it over?
/steven

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Wright  
View profile  
 More options Aug 6 2012, 4:33 pm
From: Brian Wright <brian.n.wri...@gmail.com>
Date: Mon, 6 Aug 2012 13:33:17 -0700 (PDT)
Local: Mon, Aug 6 2012 4:33 pm
Subject: Re: [dotnetopenauth] Requires HTTPS

Thanks for the help and encouragement.  I took your advise and turned on tracing and oddly, if I am doing it right, nothing is traced.  Much like the logging behavior I described, if I hit the issuer URL directly via browser, then I do get tracing.

So I went back to my tracing code that I posted earlier.   (here it is again)

Client Code (Console app)
---------------

private static IAuthorizationState GetAccessToken()
{
        var authorizationServer = new AuthorizationServerDescription
        {
                TokenEndpoint = new Uri("http://localhost:20932/OAuthToken"),
                ProtocolVersion = ProtocolVersion.V20
        };
        var client = new WebServerClient(authorizationServer, "zamd", "test1243");

        var state = client.GetClientAccessToken(new[] { "http://localhost/" });
        return state;

}

-----

It turns out that I can put any bogus non-existent address I want to in the TokenEndPoint and I get the exact same message.  I get the message on the call to GetClientAccessToken.

It would appear that this requirement is being enforced by the client code before any call to the issuer is even made.  Is there anything on the client I can configure to stop this behavior?

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew Arnott  
View profile  
 More options Aug 8 2012, 2:59 pm
From: Andrew Arnott <andrewarn...@gmail.com>
Date: Wed, 8 Aug 2012 11:59:08 -0700
Local: Wed, Aug 8 2012 2:59 pm
Subject: Re: [dotnetopenauth] Requires HTTPS

Brian,

Yes, DNOA enforces all rules on all parties.  You need to set
relaxSslRequirements on the client (console app) as well.

--
Andrew Arnott
"I [may] not agree with what you have to say, but I'll defend to the death
your right to say it." - S. G. Tallentyre

On Mon, Aug 6, 2012 at 1:33 PM, Brian Wright <brian.n.wri...@gmail.com>wrote:

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »