|
From: Noble, A. (AS01) <Ash...@ho...> - 2015-06-12 05:37:17
|
Hi All,
I'm trying to use the ReadWriteSparqlConnector to connect to a BlazeGraph store that is authenticated with OAuth (Azure Active Directory). Generally making OAuth calls I add an Authorization header to the request, but with the SparqlRemoteEndpoint the only thing I can set is the NetworkCredential which can't handle OAuth.
Is there any suggested way to be able to add a header to the rest calls that ReadWriteSparqlConnector makes?
Here is a working example of what I'm doing with Basic auth, but I need to update it to talk OAuth:
var networkCredential = new NetworkCredential(_rdfServerConfig.UserName, _rdfServerConfig.Password);
var endpointUri = new Uri(string.Format("{0}/bigdata/namespace/{1}/sparql", _rdfServerConfig.RdfServer,_rdfServerConfig.DefaultDb));
var queryEndpoint = new SparqlRemoteEndpoint(endpointUri) { Credentials = networkCredential };
var updateEndpoint = new SparqlRemoteUpdateEndpoint(endpointUri) { Credentials = networkCredential };
VDS.RDF.Options.ForceHttpBasicAuth = true;
return new ReadWriteSparqlConnector(queryEndpoint, updateEndpoint);
Cheers,
Ash.
|