Supporting both Windows and Basic Auth

4 posts, 0 answers
  1. Keith
    Keith avatar
    17 posts
    Member since:
    Mar 2011

    Posted 15 Feb 2012 Link to this post

    I have a ReportService.svc that is called from clients that are either passing credentials using Windows or Basic auth depending on their browser.  How can I support both Windows and Basic auth calls to the ReportService.svc from Telerik Reporting for Silverlight?

    <basicHttpBinding>
        <binding name="basicBinding">
            <security mode="TransportCredentialOnly">
                <transport clientCredentialType="Windows" />
            </security>
        </binding>
    </basicHttpBinding>

  2. IvanY
    Admin
    IvanY avatar
    416 posts
    Member since:
    Sep 2012

    Posted 20 Feb 2012 Link to this post

    Hello Keith,

    What you can do is create two services, the first will handle the Windows authentication and the second will handle the Basic authentication. If Windows authentication fails you can fallback to Basic authentication.

    One service with BasicHttpBinding cannot support multiple authentication mechanisms, because the ClientCredentialType is a single object and not a collection and the HttpClientCredentialType enumeration does not contain mixed modes.

    Multiple Authentication Support will come with WCF 4.5 - until then you will have to use workarounds.

    Greetings,
    IvanY
    the Telerik team

    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

  3. Keith
    Keith avatar
    17 posts
    Member since:
    Mar 2011

    Posted 22 Feb 2012 Link to this post

    Where do you suggest I handle the auth error at?  I am using the Silverlight ReportViewer and it has the ReportServiceUri hardcoded.

  4. IvanY
    Admin
    IvanY avatar
    416 posts
    Member since:
    Sep 2012

    Posted 27 Feb 2012 Link to this post

    Hello Keith,

    If you have two services you will need two clients for these services as well. If the first client raises an error you can try the second one. As for the ReportServiceUri - it is a public property with getter and setter, so it can be manipulated at any time. Here is the Reporting API Reference for the property.

    Greetings,
    IvanY
    the Telerik team

    NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.

Back to Top