Skip to main content
A newer version of this page is available. .

UriJsonSource.AuthenticationInfo Property

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

Namespace: DevExpress.DataAccess.Json

Assembly: DevExpress.DataAccess.v19.1.dll

Declaration

[Browsable(false)]
public HttpBasicAuthenticationInfo AuthenticationInfo { get; }

Property Value

Type Description
HttpBasicAuthenticationInfo

An object that specifies the Username and Password parameters.

Remarks

If the JsonDataSource object retrieves JSON data from a web service endpoint that requests authentication, you should specify authentication parameters. For this, you can use the UriJsonSource‘s AuthenticationInfo property. Set this property to the HttpBasicAuthenticationInfo object and specify this object’s Username and Password properties.

public static JsonDataSource CreateReportDataSourceWithAuthenticationInCode() {
    // 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