Everyone. Hello.
Please tell me about Hub Certification!
Can I authenticate the Hub from a different web server than the Hub server?
We would like to use Basik authentication, Bearer authentication, and issue cookies.
I followed this site and tried to LOGIN.
https://{HubServer}:9953/foundation/hub/doc/security
POST api/v1/security/login
{
"client_id": "foundation-hub",
"username" : "scitegicadmin",
"password" : "xxxxxx"
}I got this error.
Access to fetch at 'https://{HubServer}:9953/foundation/hub/api/v1/security/login?&format=json' from origin 'https://{WebServer}' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.Is there a place in the Foundation Hub to set up Allow Cross-origin Requests?
ps.
When logging into BIOVIA, it appears that the user authentication is done by logging in as a Hub user. User authentication (e.g. Basic) is also required when using the same browser to operate the GUI of an external web server to execute the PLP protocol.
const server = "https://{PLPServer}:9943";
const path = "/protocols/Web Services/Examples/Generic/Compute Statistics";
const query = "\\\$streamdata=Values&Data=1.14&Data=4.76&Data=92.65&Data=-80.46&Data=15.23&Statistics=Mean&Statistics=StdDev&Statistics=N";
const format = "";
async function startFetching() {
const response = await fetch(server + path + "?" + query + format, {
method: "GET",
headers: {
Authorization: "Basic " + btoa("scitegicadmin:scitegic"),
},
});
const json = await response.json();
}However, the Basic authentication described in this code seems like a useless task (since you are already logged in as a Hub user on the browser).
How can I use the information (cookie, JSESSIONID, etc.) that I logged in as a Hub user to run the protocol?
Thanks.
