I'm trying to use federated queries with Jena via a Fuseki endpoint. With the SERVICE keyword in my SPARQL query, I'm connecting to a Stardog endpoint. As it's a secured URL, the endpoint is specified as follows: http://admin:admin@url. As this is not secure, Jena shows the following message:
Code: 36/HAS_PASSWORD in USER: Including passwords in URIs is deprecated.
According to the docs, you can specify srv:queryAuthUser and srv:queryAuthPwd for the credentials. Is there any way to do this directly in the SPARQL query? Or, can it be configured in Fuseki (ttl file)?
EDIT
When I use @RobV's solution, the service context doesn't seem to be picked up. This is what the context looks like:
symbol:http://jena.hpl.hp.com/ARQ#regexImpl = symbol:http://jena.hpl.hp.com/ARQ#javaRegex
symbol:http://jena.hpl.hp.com/ARQ#constantBNodeLabels = true
symbol:http://jena.hpl.hp.com/ARQ#strictGraph = false
symbol:http://jena.hpl.hp.com/ARQ#strictSPARQL = false
symbol:http://jena.hpl.hp.com/ARQ#stageGenerator = com.hp.hpl.jena.tdb.solver.StageGeneratorDirectTDB@6f2dd58d
symbol:http://jena.hpl.hp.com/ARQ#enablePropertyFunctions = true
symbol:http://jena.hpl.hp.com/ARQ#romanNumerals = false
symbol:http://jena.hpl.hp.com/ARQ#optFilterPlacement = false
symbol:http://jena.hpl.hp.com/ARQ#registryPropertyFunctions = com.hp.hpl.jena.sparql.pfunction.PropertyFunctionRegistry@6f05ca41
symbol:http://jena.hpl.hp.com/ARQ/system#opExecutorFactory = com.hp.hpl.jena.tdb.solver.OpExecutorTDB$1@2a1f5501
When I leave the Fuseki config as is, and add the service context in my business layer, the service context does seem to be added:
symbol:http://jena.hpl.hp.com/Service#serviceContext = {http://host:5820/db/query=symbol:http://jena.hpl.hp.com/Service#queryAuthPwd = usr
symbol:http://jena.hpl.hp.com/Service#queryAuthUser = pwd}
Eitherway, I'm still getting an unauthorized message when I execute a federated query.