UriJsonSource.AuthenticationInfo Property

Specifies the Basic authentication parameters that the associated web service endpoint requests.

Namespace: DevExpress.DataAccess.Json

Assembly: DevExpress.DataAccess.v20.2.dll

Declaration

[Browsable(false)]
public HttpBasicAuthenticationInfo AuthenticationInfo { get; }
<Browsable(False)>
Public ReadOnly Property AuthenticationInfo As HttpBasicAuthenticationInfo

Property Value

Type Description
HttpBasicAuthenticationInfo

An object that specifies the Username and Password parameters.

Remarks

Use this property to provide authentication credentials to a JSON web service endpoint. Set this property to a HttpBasicAuthenticationInfo object and specify this object's Username and Password properties.

public static JsonDataSource CreateDataSourceWithAuthenticationInCode() {
    // Create a new UriJsonSource object and configure authentication data in it
    var jsonSource = new DevExpress.DataAccess.Json.UriJsonSource();
    jsonSource.Uri = new Uri(@"http://northwind.servicestack.net/customers.json");

    jsonSource.AuthenticationInfo.Username = "user";
    jsonSource.AuthenticationInfo.Password = "pwd";

    // Create JsonDataSource
    var jsonDataSource = new DevExpress.DataAccess.Json.JsonDataSource() {
        JsonSource = jsonSource
    };
    jsonDataSource.Fill();
}
NOTE

You can also specify authentication parameters in the application's connection string and assign the connection name to the JsonDataSource's ConnectionName property.

Refer to the Provide Authentication to Access JSON Data (Runtime Sample) topic for information on how to provide a report's JSON data source with authentication parameters at runtime.

See Also