I am trying to submit a sitemap.xml programmatically, following instructions here:
https://developers.google.com/webmaster-tools/search-console-api-original/v3/sitemaps/submit#auth
I do:
// Just call this once to set JWT
HTTPJWT.setJWTOptions({
email : "[ client ID up to the first dot ]#developer.gserviceaccount.com",
key : Assets.getText("key.pem"), // Get key file from assets
scopes : [
"https://www.googleapis.com/auth/webmasters"
],
});
var submitUrl = "https://www.googleapis.com/webmasters/v3/sites/https%3A%2F%2Fwww.spoticle.com/sitemaps/https%3A%2F%2Fwww.spoticle.com%2Fsitemap.xml";
var result = HTTPJWT.get(submitUrl);
... and here is the result:
Error: failed [400] { "error" : "invalid_grant", "error_description" : "Invalid JWT Signature." }
I can, however, generate a JWT by doing:
var jwt = GoogleOAuthJWT.encodeJWT({
email : "[ client ID up to the first dot ]#developer.gserviceaccount.com",
key : Assets.getText("key.pem"), // Get key file from assets
scopes : [
"https://www.googleapis.com/auth/webmasters"
]
});
... but I don't know how to verify that this token is valid.
Any help appreciated. Thanks.
Related
Hello im new to auth0 and i want to know why is this working:
im making a post request to /dbconnections/signup with this body :
{
"client_id" : "CLIENT_ID",
"email" : "myemail",
"username" : "myuser",
"password" : "mypass",
"connection" : "Username-Password-Authentication"
}
this returns “connection is disabled” because i have it disabled for the client but for some reason when i leave the client_id empty it says the account is created :
{
"client_id" : "id_generated",
"email_verified" : false,
"email" : "myemail"
}
thanks
why does it work when client_id is empty
i asked the same question on the auth forum and the reason why is this working is because apparently client_id is not actually required for the /dbconnections/signup endpoint despite what the documentation said: https://community.auth0.com/t/please-why-does-this-work-when-client-id-is-empty-here/96211
I'm trying to read insights of my Twitter account with Twitter Insights API and when I request to that given end point I get and error called :
{
"errors": [
{
"code": "UNAUTHORIZED_ACCESS",
"message": "This request is not properly authenticated"
}
],
"request": {
"params": {}
}
}
This is the end point I tried :
https://ads-api.twitter.com/2/insights/accounts/:account_id/available_audiences
I used the given credentials like Consumer Key, Secret and Token, Token secret.
Can anyone explain me why I'm getting this error ? And what I should do ?
Here is a screenshot
Header:
You have to check box "Add params to header"
Everything else should be ok. Just check Consumer Key, Consumer Secret,... data
I have a mobile app containing payment method via MasterCard. I have this tutorial:
https://ap-gateway.mastercard.com/api/documentation/apiDocumentation/rest-json/version/latest/api.html?locale=en_US
I want to create Tokenization which contains customer's master detail, I have followed this tutorial part:
https://ap-gateway.mastercard.com/api/documentation/apiDocumentation/rest-json/version/latest/operation/Tokenization%3a Create or Update Token (with system-generated token).html?locale=en_US
I tried with :
POST https://ap-gateway.mastercard.com/api/rest/version/41/merchant/{{MyMerchantID}}/token
Params:
{
"sourceOfFunds": {
"type": "CARD",
"provided": {
"card":{
"number": "5123450000000008",
"expiry": {
"month": "05",
"year": "17"
}
}
}
Note: The number is a mastercard test number.
I am always get this error:
error
cause "INVALID_REQUEST"
explanation "Invalid credentials."
result "ERROR"
I followed the params in second URL.
Can anyone help? Are the params correct or I missed something?
In your configuration file, you need to set the following:
$configArray["merchantId"] = "[merchantId]";
// API username in the format below where Merchant ID is the same as above
$configArray["apiUsername"] = "merchant.[merchantId]";
// API password which can be configured in Merchant Administration
$configArray["password"] = "your api password";
Setting the above parameters in the config file will solve your problem
Try replacing "ap-gateway" with the real gateway provided for you. Your merchantID is not supported in test gateway.
First, you should ask you bank to enable the tokenization for your merchant account
POST
https://ap-gateway.mastercard.com/api/rest/version/61/merchant/{{MyMerchantID}}/token
you have to set Authorization->Basic Auth
Username : Your_MerchantID
Password : ApiPassword
Params:
{
"session": {
"id": "SESSION0002510583427E2239608H32"
}
}
I get "No session ID found " on Yodlee login API call. Although I am passing correct cobSessionToken.
Endpoint: https://rest.developer.yodlee.com/services/srest/restserver/v1.0/authenticate/login
I am passing input parameters in body
{"cobSessionToken":"08062013_0:a401c173dc5440a4d1844623b85b3aa0113e8888cefade55da62fee5bfb029500ed82a272bc8c11a44f42eb55832c1eebdc5503ff06fda9bbc62b91192acd984",
"login":"*******","password":"*******"
}
Response:
{
"Error": [
{
"errorDetail": "No session ID found "
}
]
}
In login and password input parameter, I had to pass autogenerated test user credentials.
Ex-
login : sbMem(userid)1
password: sbMem(userid)1#123
And content-type should have x-www-form-urlencoded.
According to the Twitter API 1.1 documentation, this should return data:
https://api.twitter.com/1.1/users/show.json?screen_name=rsarver
But I keep getting
{"errors":[{"message":"Bad Authentication data","code":215}]}
Am I doing something wrong?
As the Twitter API 1.1 documentation indicates, you need to be authenticated in order to access users/show.
You can use codebird js library for getting tweets. All you need is to create an app on twitter and note down the following :
1.Consumer Key
2.Consumer Secret Key
3.Access Token
4.Access Token Secret
Download codebird js Library from here : https://github.com/mynetx/codebird-js
USAGE :
var cb = new Codebird;
cb.setConsumerKey('YOURKEY', 'YOURSECRET');
cb.setToken('YOURTOKEN', 'YOURTOKENSECRET');
cb.__call(
'oauth2_token',
{},
function (reply) {
var bearer_token = reply.access_token;
}
);
cb.__call(
'search_tweets',
{
q : "your query which you want to search",
from : twitter_user
},
function (data)
{
console.log(data);
},
true // this parameter required
);