cancel
Showing results for 
Search instead for 
Did you mean: 

SAP API Management - Developer Portal and OpenAPI securitySchemes

mike_zaschka
Active Participant

We have documented and protected API Proxies in SAP API Management according to the official documentation. I added the corresponding security schemes (APIKey and oAuth2 flow) to the OpenAPI specification of the API Proxy:

security:
  - oAuth2: []
  - ApiKeyAuth: []
components:
  securitySchemes:
    oAuth2:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: >-
            https://xxx.authentication.eu20.hana.ondemand.com/oauth/token?grant_type=client_credentials
          scopes: []
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

My expectation would be, that this kind of information is also available in the Developer Portal, but sadly it is not.
When I hit the Try out button, there is no related info, on how to authenticate. I could manually add the APIKey header and an otherwise acquired Bearer token, but I need to document this somewhere else or in pure textual form in the API description.

When I look at the Code Snippets, then I get some hints about authentication:

But it's also not sufficient, because the oAuth2 documentation is completely missing (tokenUrl, etc.).

In the SAP API Business Hub, there is the possibility to add authentication information. Can this functionality also be enabled in SAP API Management or, if not, how can the information be published in the Developer Portal?

mike_zaschka
Active Participant
0 Kudos

Maybe some experts from SAP have an answer. svenhuberti, can you comment on this?

former_member105769
Participant
0 Kudos

It's a valid question, which I also have.
The lack of response is dissapointing.

Accepted Solutions (0)

Answers (1)

Answers (1)

larshp
Active Contributor
0 Kudos

similar problem, I ended up with the following, note templates doesnt work for tokenUrl, in json,

  "components": {
"securitySchemes": {
"oauth2sample": {
"type": "oauth2",
"flows": {
"clientCredentials": {
"tokenUrl": "https://{subaccount}.authentication.{region}.hana.ondemand.com/oauth/token",
"scopes": {}
}
}
}

},