Forum Discussion

savarkaul's avatar
savarkaul
New Contributor
4 years ago
Solved

OAuth2.0 Client Credentials Parameters

Hi Team,

 

I'm fairly new to Swagger Editor and API documentation and I have to add a parameter to pass my access token in the API documentation. I am using OAuth 2.0 with Grant Type- Client Credentials. I am able to lock the APIs using the Authorize button on my Swagger's interactive UI but I need to view the generated access token on my interactive UI.and send it as a header parameter to specific APIs.

 

This is the security component I have added to my document:

 

components:
securitySchemes:
oAuth2ClientCredentials:
type: oauth2
flows:
clientCredentials:
tokenUrl: 'https://localhost:8081/oauth/token'
scopes: {}

 

Thanks in advance!

  • Hi, HKosova thanks for the help but I had already done that!

    Actually, I was confused about needing a parameter to send the generated access token as a parameter but after some research, I have come to know that for the grant type, Client Credentials -> when we click on Authorize button, the generated access token gets embedded within the cURL and goes with the GET/POST call in the header, along with the other parameters specified in the documentation. 

2 Replies

    • savarkaul's avatar
      savarkaul
      New Contributor

      Hi, HKosova thanks for the help but I had already done that!

      Actually, I was confused about needing a parameter to send the generated access token as a parameter but after some research, I have come to know that for the grant type, Client Credentials -> when we click on Authorize button, the generated access token gets embedded within the cURL and goes with the GET/POST call in the header, along with the other parameters specified in the documentation.