Details of 0auth2 missing in Postman import

Viewed 113

I'm using a swagger 2.0 file as a base and Postman 3.3.9 is that matters.

I'm trying to make the swagger as complete as possible so it's easy for non-technical users to use postman and call our APIs. To accommodate for this, a security definition was added to the top level, which looks like this:

  "securityDefinitions": {
    "OAuth2": {
      "type": "oauth2",
      "flow": "accessCode",
      "authorizationUrl": "https://<<myserverhere>>/oauth2/authorize",
      "tokenUrl": "https://<<myserverhere>>/oauth2/token",
      "scopes": {
        "usr_change": "Change users.",
        "usr_read": "Reads user details."
      }
    }
  }

This definition is not used on the top-level (i.e. in the collection) but instead on the requests, based on their scope, like so:

"security": [
  {
    "OAuth2": [
      "usr_read"
    ]
  }
],

When importing this file into Postman (using scratchpad), it is imported as a Collection. I can see with the individual requests that they have something under the "Authorization" tab which corresponds to the type "0Auth 2.0", but all the details except for the grant type are missing. So, no tokenurl is prefilled, no auth. url either and also the provided scope is missing, even though all are available in the security definition of the swagger file.

Is this to be expected when importing the swagger file or am I missing something in the file itself?

NOTE: I'm not in a position currently to port this to an openapi 3.0 specification at this current time.

[EDIT] Apparently, this works the same on OpenAPI 3.0 definitions (as in; they also don't show them on sublevels). Furthermore, I have already seen and checked this option whilst importing:

Include auth info in example requests
Select whether to include authentication parameters in the example request

This was already set to true.

0 Answers
Related