6

I'm developing a site that uses OpenID for authentication, which is working fine however... I often work on it while travelling without an internet connection. If the session expires and I need to login again, I can't until I have connectivity again.

What I'd like to do is setup a really dumb OpenID provider on a local IIS, that I can use to login while disconnected. By really dumb I mean just that - it just needs to be a hard coded URL that responds correctly as an openID provider and allows login.

I've had a quick look at the OpenIdProviderMvc sample included with DotNetOpenAuth, but it didn't compile out of the box (couldn't resolve assembly ApplicationServices). Before I dig in deeper, I thought someone might have already been through this process.

skaffman
  • 398,947
  • 96
  • 818
  • 769
Brad Robinson
  • 44,114
  • 19
  • 59
  • 88

1 Answers1

4

So I figured this out. The OpenIdProviderMvc sample project included in DotNetOpenAuth works fine.

Main thing that I got stuck on is that the relying party site needs to have localhost whitelisted as follows:

In the configSections section of web.config:

  <section name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection" requirePermission="false" allowLocation="true"/>

And this as a new config section:

 <dotNetOpenAuth>
  <messaging>
   <untrustedWebRequest>
    <whitelistHosts>
     <add name="localhost" />
    </whitelistHosts>
   </untrustedWebRequest>
  </messaging>
 </dotNetOpenAuth>

If you're interested, I've also knocked together an even more dumbed down provider "localid" which let you login using an OpenID like this: http://localid/member/anythingyoulike. No login screens, just an infinite array of valid OpenID identifiers. More info here.

Brad Robinson
  • 44,114
  • 19
  • 59
  • 88
  • You don't have to write your own Provider for the offline scenario. The DotNetOpenAuth Tools package (https://www.ohloh.net/p/dotnetopenauth/download?package=DotNetOpenAuth-Tools&release=3.4.5) includes an "offline OpenID Provider" .exe that provides several features that you can use to not only log into your RP while offline, but test a few scenarios of your RP as well. – Andrew Arnott Sep 11 '10 at 02:43
  • Hi Andrew. Thanks for that, but I just downloaded and ran it and just crashes :(. Is there something special I need to do to set it up? Actually I'm quite happy with what I've currently got cause it just sits there unobtrusively in the background. Still good to know about the tools package. – Brad Robinson Sep 11 '10 at 07:29