Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

open API spec file for OAuth flows

Hello,

We are working on OAuth2 password and client credentials scenarios. So we created 2 APIs(provider and consumer ) and added APIs to the product, added product to the app. we need to publish the APIs to the portal.

At present we created single spec file relates to consumer API and added security at method level, security Schemes(with type, flows,token URL(provider API URL), scopes) under components. After publishing authorise button is enabled in portal. Here we are getting authorisation failed error even though correct credentials given..

1) For this do we need to create separate spec files for both the APIs or single spec file ?

2) How the consumer api get the token if we use single spec file for the both apis ?

3) How the flow executes?

Thanks.

Solved Solved
0 6 832
1 ACCEPTED SOLUTION

@subrahmanyam battula - I think you are doing the right think. I am assuming that you are getting a CORS error. Please enable the Developer tools on your browser and make a call to get a token from the portal, you should see an error. This is due to CORS. You will need to include that to all your proxies. For more info, check this link. The link also has an example repo you can look at for reference.

View solution in original post

6 REPLIES 6