401 unathorised error while testing api in jmeter - api

I am getting 401 unauthorised error while testing apis in jmeter.
I checked end url, query parameters everything is correct, also username and password is correct, still I am getting the error. Kindly help.

Related

The response of Authentication grant code is 200 Ok. But not getting the code

The response of Authentication grand code for the request which i pass is 200 Ok. But am getting an html response in that. i couldn't find any code. Can You please help me.?
https://account-d.docusign.com/oauth/auth?response_type=code&scope=signature&client_id=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXfeeb89&redirect_uri=https://localhost:44330/callback
This is the request which i send. But not receiving the authentication code. But It shows 200 OK.
In the admin tool, check that your integration key is set to use Authorization Code grant, not Implicit grant.
Also check that you've authorized your exact callback URI for your integration key.
If you're not getting any errors from DocuSign, then authenticate yourself and the your browser will then be redirected to your redirect uri, in this case https://localhost:44330/callback

What could be the reason for Okta Log Api giving internal Server Error 500 through code but giving result when run from Postman

I have a windows service which hits Okta Event Api
http://developer.okta.com/docs/api/resources/events.html
Now I have changed code to hit Okta Log Api
http://developer.okta.com/docs/api/resources/system_log.html
Problem : While Log api Get request works fine from postman tool it gives "Internal Server Error 500" when i run it from Code. The previous Event Api works perfectly fine from code and postman both.
This is what I get in response:
{"errorCode":"E0000009","errorSummary":"Sorry, there's been an error. We aren't sure what caused it, but we've logged this and will work to address it. Please try your request again.","errorId":"7f997bbe-7a31-4431-9f42-ae40db5200ac"}
What could be a possible reason for this?

How to return 400 http error code instead of 401 without any scripts?

I need to return error code 400, when user enter bad credintials for suppress browser's basic auth dialog
But i cannot change response code on server side.
I guess it is possible with some .htaccess rules, but google don't have a answer to my question, i just found solutions for 403 -> 404, but it don't work for me.
How can i do that?
You can send custom error responses but you cannot change the actual error code returned. That would be a very practice.
See https://httpd.apache.org/docs/2.4/custom-error.html
Btw, if you enter bad credentials, you will be taken to the 401 page. You'll only get the auth dialog again if you try to reload the page (or, try to load protected items from the 401 page itself, which of course creates an infinite loop and never allows you to escape the auth dialog).

"Sorry, an error occurred while processing this request" instagram api python-instagram

I'm using python-instagram library to get access to instagram api. But when I run my app (flask rest api application), my auth method which use InstagramAPI and get_authorize_login_url method raise 500 error:
raise OAuth2AuthExchangeError("The server returned a non-200 response for URL %s %s %s" % (url, response['status'], content))
OAuth2AuthExchangeError: The server returned a non-200 response for URL https://api.instagram.com/oauth/authorize?scope=basic&redirect_uri=http%3A%2F%2Fsocialservice.test.5-soft.com%3A8515%2Finstagram%2Fauth&response_type=code&client_id=c5095d88cee14bac91a9341e6e82ff8f 500 Sorry, an error occurred while processing this request.
In my local machine it works without any problems but in the production server with different IP I've got this problem.
I would be very appreciative if someone can help to solve me this problem
Thanks in advance,
Ron
Please clarify:
In my local machine it works without any problems but in the production server with different IP I've got this problem.
How can you be performing authorization on your local machine? Instagram's API requires a public url for redirect_uri.
Next, I haven't found any evidence to verify this, but I don't believe you can specify a custom port in your callback url (you've provided http://socialservice.test.5-soft.com:8515/instagram/auth).
Last, assuming it's your callback server that is the problem, that error usually occurs when you aren't returning the correct response back to Instagram. The server needs to echo out only the value of the GET parameter code as plaintext.
If I browse to here: http://socialservice.test.5-soft.com:8515/instagram/auth?code=test I get no response, which is likely the cause of your error.

Getting Invalid Authsub Token Error 403

I am trying to authenticate my application using Blogger API but when user grant access to the application and blogger api return the token and the token i use to exchange the by sending the request on https://www.google.com/accounts/AuthSubSessionToken it return an error called Error 403 Invalid AuthSub Token. Kindly help me in this regard to debug the problem and solve it. Thanks in Advance
after doing some experiment, here it is some advice :
change secure to zero
https://www.google.com/accounts/AuthSubRequest?scope=https://gdata.youtube.com&session=1&secure=0&next=http://www.example.com
make sure you are requesting from http for and request in http again in future
https://www.google.com/accounts/AuthSubRequest?scope=http://gdata.youtube.com&session=1&secure=0&next=http://www.example.com
it's worked like a charm for me...