Search code examples
asp.netweb-servicesdotnetopenauthdatacontract

Using a different service contract for DotNetOpenAuth


Recently the company I work for has decided to use DotNetOpenAuth to authorize users who want to make use of a certain webservice I've been developing.

Now, I have a SOAP webservice up and running, and I also have the OAuthConsumer and OAuthServiceProvider samples from DotNetOpenAuth running. The webservice, consumer and service provider all run on IIS7, each in their own site.

My question is, how can I call a method from my webservice's datacontract, rather than a method from DotNetOpenAuth's IDataApi datacontract?

Would I need to build a new version of the DataApi class? In that case, what should this new class extend to (rather than IDataApi)?

Thank you!


Solution

  • IDataApi is simply the [ServiceContract] in the sample. You should use the interface that describes your service instead. Is this SOAP service based on WCF? If so, simply use your interface.

    If you're not using WCF then the framework you're using will determine how to hook into its authorization system, and perhaps make your implementation radically different from the sample's. But using DotNetOpenAuth with it should still work.