views:

90

answers:

1

I want to add some authentication to my odata service. The authorization token i want to include in the url as param so that the url can be used in excel

How would one be able to receive and parse any addition param supplied in the url before the odata service does it's thing?

(i'm using entitie framework and wcf dataservices)

+1  A: 

There are a lot of places where you can try to implement the authentication of your odata service. Here is some examples:

You can try to solve your problem with QueryInterceptor (see http://msdn.microsoft.com/en-us/library/dd744842.aspx and http://msdn.microsoft.com/en-us/library/dd744837.aspx).

Another way is usage of ProcessingPipeline event handlers. It will be called not only for GET requests.

You can look at http://stackoverflow.com/questions/2062822/authenticating-wcf-dataservices. It's depend on your implementation of authentication, but it can be this example is what you want. One use here headers for authentication information, you can use URL parameter only if it is required in your implementation.

To access URL parameters you can use Request.QueryString (see Application_BeginRequest from http://josheinstein.com/blog/index.php/2010/05/wcf-data-services-format-json/)

Oleg
@oleg thanks for giving all these alternate approaches. The last link seems the best match for my situation
Toad