Community Discussion
Trying to get my access Token via Password Credentials flow but receive error "false"
Hello,
As stated in the topic, I am trying to get the access token that will allow me to manipulate the Backstage API but when trying the Password Credentials flow I am receiving the error "False".
Here is the function to fetch the token:
const credentials = {
this is where my credentials are registered
}
function fetchTaboolaAccessToken() {
const options = {};
options.method = 'post';
options.headers = {
'Content-Type': '"application/x-www-form-urlencoded"'
};
options.body = {
client_id: credentials.client_id,
client_secret: credentials.client_secret,
username: credentials.username,
password: credentials.password,
grant_type: 'password'
};
const result = fetchUrl('https://backstage.taboola.com/backstage/oauth/token', options)
console.log("Result", result);
}
Can someone tell me what is wrong in my function for this error to be logged ?
jsdata_studio_connectorx-www-form-urlencodedoauth2client_credentials401google_scriptbasic_authenticationjavascriptfull_authentication
Posted by Alexandre Macrel over 3 years ago
Authorisation Code method redirect issue
Iβm hoping someone can help with a stumbling block Iβm facing with our auth flow. Iβm trying to use the Authorisation Code method outlined in the api docs (https://developers.taboola.com/backstage-api/reference#authorization-code) as follows:
This flow is similar to Implicit Grant (above), but involves an additional step:
User clicks on Connect within your App.
Your App redirects the user to a Taboola login page:
[authentication_domain]/authentication/oauth/authorize/?client_id=[client_id]&redirect_uri=[redirect-uri]&response_type=code
Note: set authentication_domain = 'https://authentication.taboola.comβ
Iβve built the Taboola login url as outlined above using our client id and desired redirect however when I test the URL and subsequent login process there is no redirect back to our app, instead the user is taken to this page within Taboola that asks whether I want to go to backstage or newsroom, both of which keep the user in Taboola.
Anyone know why I canβt redirect back out to our app to complete the authors flow?
Posted by Matt over 4 years ago