Can i get an example of the structure for calling xirsys live meeting api through angular $http......url->https://service.xirsys.com/_r/live/meeting
This is format of making a ajax call to Xirsys live meeting api.
$.ajax({
url: "https://service.xirsys.com/_r/live/meeting",
type: "GET",
data: {
username: "username:token",
params: {
username: "me!",
path: "/DomainName/default/default",
meeting_id: meetingId
}
}
Username,token are only provided to premium user by Xirsys.
Related
For one reason or the other Auth0 expects an audience parameter in the header of your authentication. This means that you cannot just use the default oauth2 clientid/secret flow which is very annoying as you somehow have to first do a raw call to get your bearer and then reuse this bearer in the rest of your calls.
Is there an easy way to add this audience parameter to a rest call in Paw?
This is the raw call I do in for example postman, before each call.
const echoPostRequest = {
url: 'https://[url].eu.auth0.com/oauth/token',
method: 'POST',
header: 'Content-Type:application/json',
body: {
mode: 'application/json',
raw: JSON.stringify(
{
//Client name: API
client_id:'',
client_secret:'',
audience:'https://[url].eu.auth0.com/api/v2/',
grant_type:'client_credentials'
})
}
};
You can specify the audience in the Authorization URL as a query parameter e.g.
https://[url].eu.auth0.com/authorize?audience=https://[url].eu.auth0.com/api/v2/
I am making a request to my auth server using the example from cypress documentation below.
https://github.com/cypress-io/cypress-example-recipes/blob/aa434ffc29946d545daf4c94019f9692eb0db3e0/examples/logging-in__single-sign-on/cypress/integration/logging-in-single-sign-on-spec.js#L47
Following is my configuration but I am getting a 400 bad request. The url should take me to the login form and authorise the user and then redirect to call back page to get the token.
Am i missing something?
const options = {
method: 'POST',
url: 'https://fakeauthserver.net/Account/Login',
qs: {
redirect_uri: 'http://localhost:9000/login/callback',
client_id: 'webapp',
response_type: 'code',
scope: 'full-access'
},
form: true,
body: {
Username: 'fakeusername#grr.la',
Password: '123456',
button: 'login'
}
};
_.extend(config);
cy.request(config)
Usually, the 400 Bad Request error occurs when you have made an error in the parameters sent in the request. Check whether you have sent all the parameters and whether they are the same as the ones registered in your identity provider.
Also, it might be due to POST request you have made here. According to the OAuth specification, authorization request should be a GET request.
My request to xirsys endpoint looks like this:
$.ajax({
type: "POST",
dataType: "json",
url: "https://api.xirsys.com/getIceServers",
data: {
ident: "username",
secret: "secret_api_key",
domain: "dummy_subdomain.domain.com",
application: "default",
room: "default",
secure: 1
},
});
However, even if the username, secret and the rest of information seem to be correct into the xirsys dashboard, I get this error: 'Could not validate application'.
Do you have any idea ?
Thank you.
Well, I tried this and I now get a 200 status, but unfortunately I get this response:
{"p":"/getIceServers","s":200,"d":{"iceServers":[{"url":"stun:127.0.0.1"},{"username":"free","url":"turn:127.0.0.1?transport=udp","credential":"free"},{"username":"free","url":"turn:127.0.0.1?transport=tcp","credential":"free"}]},"e":null}
Which I think is a default response.
What could I do wrong ?
Currently, XirSys doesn't support the posting of JSON to its endpoints. You'll need to change it to posting standard POST cars for it to work. JSON support will be added very soon.
Regards,
Lee
I have an authentication webservice sitting at http://example.com:9080/auth/login that accepts a POST request with www-url-form-encoded encoding and responds back in JSON format.
I am currently going through the Adapter-based Authentication tutorial. Inside the body of submitAuthentication(username, password) in SingleStepAuthAdapter-impl.js, I have the following:
function submitAuthentication(username,password):
var input = {
method: "post",
path: '/auth/login',
returnedContentType: 'json',
body: {
content: JSON.stringify({"username":username, "password":password}),
contentType: "application/x-www-url-formencoded;charset=utf-8"
}
var returnData = WL.Server.invokeHttp(input)
The problem I am having is that the server (locally hosted websphere) is not receiving my username and password. Am I missing something here?
You could add a header to the request with basic authentication credentials such as:
var input = {
method: "post"
returnedContentType: 'application/json',
path: path,
headers: {
'Authorization': 'Basic '+ base64_encode(username+':'+password),
You could also make the request and then store a secure cookie and attach it as a header on future requests following this post:
Attaching cookie to WorkLight Adapter response header
I've got everything working up until Step 2 of the OAuth process where you request the actual token. I'm using a very simple jQuery Post request and constantly getting Access Control Origin errors. I've tried contentType: 'application/json' and everything else I know to try.
It's just not working and I'm not sure the problem. I've confirmed all the variables are set properly before the request. Simple post request...
var url = 'https://[STORENAMEVARIABLE].myshopify.com/admin/oauth/access_token';
var data = JSON.stringify({ client_id: apiKey, client_secret: secret, code: code });
$.ajax({
type: 'POST',
url: url,
data: data,
success: function(data) {
debugger;
},
error: function(data) {
debugger;
}
});
Any ideas what I'm doing wrong?
You need to make your OAuth requests from a server. This is the Javascript cross-domain security kicking in.
If you are using Rails you can use omniAuth and it'll take care of the whole OAuth dance for you. Otherwise you'll have to search around but most popular language have an OAuth library that you can just plug in.