I'm trying to run newman with postman collection from a url as mentioned in this link .
newman run http://localhost:62254/api/postman
Only catch is that the url is under windows authentication, so I'm getting a 401 Unauthorized response, causing newman to fail with below error.
the url "http://localhost:62254/api/postman" did not provide valid JSON data
I tried passing the credentials with the request like below. But it didn't work.
http://username:password#localhost:62254/api/postman
If I directly hit the endpoint with Postman using 'NTLM Authentication' feature it works fine. But I'm not sure if I can use this with newman to get the collection itself.
We were not able to find any option in Postman/Newman. So finally we made this URL alone (http://localhost:62254/api/postman) open to Anonymous Authentication in the web server.
Related
I am implementing WeChat SSO for my web application, I have developer account, created an application there, followed this article exactly. I am using React on front-end and flask on backend.
I am using this package for flask for WeChat-sso.
So in my weChat dashboard I have registered official website e.g (chess.com), but I have to use callback url in such way so I can test redirection on my dev server.
My dev front-end is on (localhost:8000/)
My backend server is running on (127.0.0.1:5050/)
I have tried saving different callback urls e.g (127.0.0.1:5050/api/users/wechat/callback), no matter what I save in callback url always receiving parameter error.
So my question is how do I actually achieve this functionality locally? Instead of parameter error I should be seeing QR code so that I can get code from which I can get access_token. Following code generates authentication url
from weixin import WXAPPAPI
from weixin.lib.wxcrypt import WXBizDataCrypt
from weixin.client import WeixinAPI
scope = ("snsapi_login",)
api = WeixinAPI(appid=WECHAT_APP_ID,
app_secret=WECHAT_APP_SECRET,
redirect_uri=WECHAT_REDIRECT_URI)
authorize_url = api.get_authorize_url(scope=scope)
The authentication url generated is as follows, redirect URI is properly encoded just like in the documentation.
https://open.weixin.qq.com/connect/qrconnect?appid=wx35c78a124e8f027b&redirect_uri=127.0.0.1%3A5050%2Fapi%2Fusers%2Fwechat%2Fcallback&response_type=code&scope=snsapi_base&state=689db1f29605481a492639e98c7b1f9f#wechat_redirect
Please look at the picture of error as well thanks
I created an AWS Lambda function which invokes the endpoint of ML model I created in sagemaker. I tested it and it's working fine. Next I created REST API that calls this lambda function. I set any authentication type as NONE. Anyone with the url can access it. I created it following this aws blog. I tested my url in postman. It's working fine in postman but when I entered the url in chrome, its throwing {"message":"Missing Authentication Token"} error. Can someone please tell how do I get rid of that error while testing my url in chrome
The error is misleading. It's got absolutely nothing to do with tokens. What is actually happening is that the URL you are trying to access is invalid.
API Gateway's URL looks like this: https://xxxxxxx.execute-api.some-region.amazonaws.com/your-stage but it's very likely that you created an endpoint on API Gateway, which would then be accessible via https://xxxxxxx.execute-api.some-region.amazonaws.com/your-stage/YOUR_ENDPOINT
If you hit the base URL or a path which does not exist, you will get that weird, misleading Missing Authentication Token message.
So, long story short, hit a valid path for your API and it should work just fine.
Tip: maybe you are doing a POST request via Postman but whenever you try with the browser it issues a GET request, which would also result in an invalid path and therefore the Missing Authentication Token message.
I'm trying to implement Outlook Oauth2 in our Django backend server which is hosted on an AWS instance.
I carefully followed the instructions in their python tutorial and it works 100% in my local machine. I am able to grab the authorization code which I then convert in my backend server to an access token.
The problem lies in our demo server which is an AWS instance. We have a button that redirects the users to Outlook authentication. The URL has the following format:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=<client-ID-here>&redirect_uri=<demo-server-redirect-url>&response_type=code&scope=openid+profile+offline_access+Calendars.ReadWrite&prompt=consent
I am receiving the following error whenever I convert the authorization code into an access token just after the consent screen:
{
'error': 'access_denied',
'error_description': 'Your credentials aren't allowed'
}
The weird thing is that if I use POSTMAN using the demo server Outlook credentials, I am able to retrieve an access token from Outlook.
Basically, it works for both in my local machine and using Postman. I really think that I'm just missing a very small piece of code/configuration here. Are there some extra settings that I need to do in order to make Outlook Oauth2 work in AWS?
We were able to fix the bug by adding User.Read into the scopes. Apparently, that's the only thing missing from all of this.
How can I setup PAW to work with Facebook locally for development? Or even at all for that matter?
I have a node.js backend that I'm setting up with Facebook Auth. Every one of my routes needs the user to be logged in. I have two endpoints related to FB Auth. localhost:3000/api/v1/loginFB and localhost:3000/api/v1/callbackFB. Both of these work great in a web browser.
loginFB simply returns this string... https://www.facebook.com/dialog/oauth?client_id=523534457345&redirect_uri=https://localhost:3000/api/v1/callbackFB&scope=email,public_profile,user_friends.
When I call that URI in a browser, it returns a code=blahblah which my callbackFB endpoint uses to fire off another request to get the access token. All good.
So now in PAW I'm confused by the difference between the request URI and the Authorization URL text field? Should I use the loginFB URI for my request URI? And then https://www.facebook.com/dialog/oauth in the Authorization URL textfield?
Basically what's happening is that when I click Get Access Token, it returns the code but my callbackFB endpoint 500's by saying "This authorization code has been used." The code that it's getting returned is definitely different each time I Get Access Token.
This is where I'm at with this thing (Client ID and Client Secret are actually my App ID and App Secret from fb's dev management site, and the Access Token URL is actually set to https://graph.facebook.com/v2.3/oauth/access_token which I'm 99% sure is the correct URI):
This is the error I get when I click Get Access Token button:
It would be awesome to get some advice from anyone with experience with this issue. Thanks.
Re: #MichaMazaheri
tl;dr Fixed in version 2.2.2
Sorry for the super late follow-up. We actually fix this exact issue in Paw 2.2.2, which is already released on our website, and pending review for the Mac App Store. (It was some JSON vs. Form URL-Encoded parsing issue). Thanks for reporting.
Does any one used django-oauth2-provider as django oauth2 solution?
I've clone django-oauth2-provider code from github https://github.com/caffeinehit/django-oauth2-provider, and run the example site provided.
But I don't know how to test it.
When I type this in my browser:
http://127.0.0.1:8000/oauth2/authorize/2/?client_id=fc79b3fd7e65b904836b
I got
unauthorized_client An unauthorized client tried to access your resources.
It seems that my client_id had failed passed to the site?
You are accessing the wrong URL:
http://127.0.0.1:8000/oauth2/authorize/?client_id=fc79b3fd7e65b904836b&redirect_uri=<REDIRECT_TARGET>&response_type=code&status=abc
Then the app redirects you to
/oauth2/authorize/2/
by either issuing an HTTP200 upon success or HTTP400 upon failure.