cannot able to connect/hit endpoint using apikey - api

not able to understand why it is not getting connected, passed everything as per documentation why getting Unauthorized, what else can i do
enter image description here

As per the documentation you should pass this as basic authentication and not api key
Set authentication as basic authentication and set username as apikey and password as eg djdkkslsllsksmsmz
https://cloud.ibm.com/apidocs/assistant/assistant-v2
In curl -u indicates username and password basic authentication

Related

Onelogin API authentication error

I am attempting a very basic call to the one login API to get an authentication token. I copied the client id and client secret correctly from the api credentials page (although the "copy to clipboard button doesn't seem to be working).
r2 = requests.post('https://api.eu.onelogin.com/auth/oauth2/v2/token',
auth=('<CLIENT ID>','<CLIENT SECRET>'),
json={
"grant_type": "client_credentials"
}
)
When I run this, I get an authentication failure error. I have no idea what I am doing wrong, any help would be really appreciated.
The client_id and the client_secret to use in this call actually are not the ones from an app configured in the oneLogin account, you have to set up some API client_id and client_secret in your oneLogin account administration page, give them at least an auth level and then use them in your call to get the tokens
Sure.
Depending on what privileges you need, there are different profiles in the Developers>API credentials section from the Administration portal.You can create a new profile by clicking in the top left blue button named "New credentials".
In your case, I think is enough with a "Authentication only" profile.
Once you have those API credentials, when you are using a BASIC authentication method, you have to set them in the JSON header, but encoded in base64, not just as plain text, and the client_id and client secret are separated by (:) not by (,).
You also need to set up the content type to "application/json" in the header.
Hope this helps.

Get images from kwikee api

How to integrate Kwikee API to get the product images or other information?
I have found the documentation on the link. https://docs.google.com/document/d/1Fm768c3PnSaBDAx1F5tjZiJkhaWzKsb13y2lbOtljhk/edit#. Here is I follow the endpoint https://api.kwikeesystems.com/v1.0/init/xml, clicking on this ask for user-name and password when I fill the user-name and password it gives me an error
"Authorization Required
This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required." Although I fill the correct user-name and password.

How to setup cURL digest authentication with Postman

How would one setup curl digest auth in postman?
Eg curl command:
curl -vL --digest --user mike:pwd -X POST --data 'hello' 'localhost:3000/duh'
I tried using digest authentication as well as basic authentication in Postman. Digest auth returned 401 whereas basic auth returned 500. So I'd say basic authentication is not the right one.
In digest auth, I set the following options.
Username: mike
Realm: {{echo_digest_realm}}
Password: pwd
Nonce: {{echo_digest_nonce}}
Everything else kept at default. I also checked the 'Save helper data to request' checkbox and Update Request button.
Still getting a 401.
According to the response, I'm getting a nonce, realm and also a qop. I didn't set this in the digest auth parameter before but decided to set it manually since it doesn't change per request. Still nothing.
{{echo_digest_*}} is a variable of Postman-Echo I known.
It seems that Postman doesn't support a digest authentication automatically.
This requirement is still open, you can check here.
So that, Postman's member suggests to use "Pre-request script" or "Tests" on the similar issue(/issues/2626).
And finally, some guy shows us the work-around like below. postmanlab GitHub
var regEx = /nonce="(.*==)"/;
var arr = regEx.exec(wwwAuth);
if (arr && arr.length > 1) {
var nonce = arr[1];
postman.setEnvironmentVariable("echo_digest_nonce", nonce);
}
You might to change the regular expression like
/nonce="(.*?)"/.
I hope it will help you.

Unable to use Resource owner credentials of Oauth2 for Rdio

We are using rdio to get music from rdio in our app. We have used OAuth2.0 for authentication. Currently we are using authorization code. I am exploring to switch to Resource owner credentials documented in (http://www.rdio.com/developers/docs/web-service/oauth2/auth-password/ref-oauth2-auth-password ). I have created the app in rdio site, obtained the client_id and client_secret. I am making POST call to https://services.rdio.com/oauth2/token and passing username= password= (HTTP Authorization header method of client verification) . The response comes as "error_code":"unauthorized_client" "error_description": "This client is not authorized to use the password grant". I have tried to substitute username and password with real username and password, but that doesn't work. Is it the validity of client_id and client_secret that is the issue? I've followed all the steps to T. Please let me know what am i doing wrong?
Regards Vinay
This OAuth 2.0 grant isn't available to every one, the documentation says:
This method is limited to trusted Rdio partners. Please contact us if you feel your application needs to use this method.

How do I pass credentials to Sonar API calls?

When I try to call:
https://sonar.mydomain.com/api/resources?resource=com.mydomain.project:MY&metrics=ncloc&format=json
I get
{"err_code":401,"err_msg":"Unauthorized"}
How do I pass my credentials?
According to the newest documentation said: SonarQube now support two way authentication:
User Token
This is the recommended way. Token is sent via the login field of HTTP basic authentication, this way will be more safety, without any password. For more information about how to generate a token, please visit this page User Token. Use curl send request like this:
curl -u THIS_IS_MY_TOKEN: https://sonarqube.com/api/user_tokens/search
# note that the colon after the token is required in curl to set an empty password
HTTP Basic Access
Login and password are sent via the standard HTTP Basic fields:
curl -u MY_LOGIN:MY_PASSWORD https://sonarqube.com/api/user_tokens/search
According to the documentation SonarQube uses basic authentication. Try:
curl -u admin:SuPeRsEcReT "https://sonar.mydomain.com/api/resources?resource=com.mydomain.project:MY&metrics=ncloc&format=json"
Obviously the mechanism for passing these credentials is dependent on how you are invoking the API.
This should also work from the web browser. Try logging into the Webui, your browser will normally cache the credentials.
This happens because authentication data does not include in your api call. This is how I solved it.
1.First install a rest client "Postman" to your browser.
2.Open it and put your API call url under "Normal" tab.
3.Go to "Basic Auth" tab and put username,password then click refresh headers.
4.Come back to "Normal" tab. You'll see a header named "Authorization" in header list.
5.Now click "send" button to view results.
6.If you are using 3rd party application, add "Authorization" header to your call with the value generated by postman.