Accessing SDS with the .NET Access Control Service

[This document supports a preliminary release of a software product that may be changed substantially prior to final commercial release. This document is provided for informational purposes only.]

As described in SDS and .NET Access Control Service Integration, SQL Data Services (SDS) supports both basic authentication and token-based authentication. The developer experience using either of these authentication schemes is same except appropriate end point name must be specified when creating the proxy. When using token based security, there are several ways to provide credentials to the identity service and obtain a token:

  • Federated accounts like Active Directory
  • X.509 certificate
  • Card Space
  • User name and password

Depending on the type of credentials you provide one of the following end point names must be specified in the code:

  • UsernameTokenEndpoint
  • CertificateTokenEndpoint
  • CardSpaceTokenEndpoint
// Using user name and password to obtain security token
using (SitkaSoapServiceClient proxy = new SitkaSoapServiceClient("UsernameTokenEndpoint"))
{
    …
}
// Using X.509 certificate to obtain security token
using (SitkaSoapServiceClient client = new SitkaSoapServiceClient("CertificateTokenEndpoint"))
{
    X509Certificate2 cert = new X509Certificate2("someCert.pfx", "password");
    client.ClientCredentials.ClientCertificate.Certificate = cert;
    ....
}

// using CardSpace to obtain security token
using (SitkaSoapServiceClient client = new SitkaSoapServiceClient("CardSpaceTokenEndpoint"))
{
    // No credentials necessary for CardSpace
    ...
}

Any of the SOAP samples provided in Examples of Using SOAP Interface with the SQL Data Services can be used with the .NET Access Control Service.

See Also

Concepts

SDS and .NET Access Control Service Integration