postman-app-support icon indicating copy to clipboard operation
postman-app-support copied to clipboard

Importing A Swagger File To Postman That Requires Authentication

Open bhreinb opened this issue 6 years ago • 9 comments
trafficstars

Hi there,

I'd like to do REST API testing through postman. Ideally I'd like to import the swagger definition from a URL (as that is the source of truth for our ever evolving set of REST APIs) and let postman convert the swagger definition to a postman collection.

That feature already works in circumstances when the swagger definition can be accessed using anonymous authentication. However, due to security constraints the swagger definition we expose are secured by basic authentication hence importing via dialog "Import From Link" fails for me.

I have tried to evolve the url to include basic authentication namely

https:username:[email protected]

but that doesn't work for me either. It would be great if their was a way to input basic authentication as part of that input interface so importing swagger via a url can work if the swagger url has anonymous or basic authentication. Thoughts?

Thanks in advance.

bhreinb avatar Sep 03 '19 09:09 bhreinb

Is their any further progress on this? We can't import a swagger file to postman that is password protected which is a real limitation.

bhreinb avatar Jun 08 '20 14:06 bhreinb

I require the same feature. I was surprised there is no way to do this.

ChristopherSnay avatar Jul 27 '20 18:07 ChristopherSnay

same here

MinghongGao avatar Oct 13 '20 08:10 MinghongGao

+1 to add ability to include auth in the import from link feature.

Further, since authentication for some may be a two step process:

  1. Provide Username:Password to fetch a Bearer Token (or whatever)
  2. Use Token in authorization header to access api endpoint to download api.json

it would be ideal to have the Import/Link screen allow me the ability to provide the user:pass required to acquire a token, then use that token in the get request for the myapi.json file I intend to import.

Maybe go as far as adding the full 'Authorization', 'Pre-request Scripts', 'Tests', and 'Variables' screens to the Import wizard similar to what is currently available for 'Collections'.

As an request for enhancement however, I would ask that Postman actually decouple the entire 'Authorization', 'Pre-request Scripts', 'Tests', and 'Variables' screens into their own 'Authorizations' object space so they can be managed as grouped collections independently from Collections and allowing them to be defined once and used across multiple collections in addition to the import feature.

Authorizations

  • MyAuth1
    • Authorization Method
    • Pre-request Scripts
    • Tests
    • Variables
  • MyAuth2
    • Authorization Method
    • Pre-request Scripts
    • Tests
    • Variables

Then let me reference my auth-group and subsequent 'Token' variable within my collections as appropriate.

dkarakas1 avatar Nov 04 '20 23:11 dkarakas1

+1 definitely a very important required feature

harshit-raj avatar Mar 29 '22 02:03 harshit-raj

+1

gedankennebel avatar May 02 '22 10:05 gedankennebel

+1

cionz0 avatar Sep 22 '22 09:09 cionz0

+1. I try to import a Pixi WSDL file. This is not working due to basic auth. Please enable either basic auth credentials or even as quick fix to allow to have the credentials in the URL.

DjThossi avatar Jul 26 '23 09:07 DjThossi

It would be a nice feature for protected APIs

pavlokomarov avatar Mar 26 '25 10:03 pavlokomarov

I have made a detailed video on this. Please check it out and let me know your feedbacks. https://youtu.be/-XPPJyhz93E?si=atLVjZVVDRGtMfSo

kishoreankit95 avatar Apr 04 '25 09:04 kishoreankit95

+1

hafsa94 avatar Apr 09 '25 06:04 hafsa94