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

Unable to get smartdoc working with oAuth2 client credentials

Not applicable

I have an API proxy working. I was able to create an API product for it and register an app. This API proxy is using client credentials oAuth grant type. I defined a /token endpoint that takes in the client id & secret and returns a token. The other endpoint in the proxies validate the access token. I'm able to call the API correctly using curl.

I used swagger (json) to create the smartdocs model and method. It is using the https scheme correctly. When I make the call I get the 401 as expected. When I click on the "oAuth2.0 Set.." button I get a pop-up, but it doesn't let me specify my client id & secret.

1889-screen-shot-2016-02-04-at-110100-pm.png

After clicking OK, I get "Unable to proceed because of missing OAuth configuration."

Here's the relevant part of the swagger doc:

    "securityDefinitions": {
        "locations_oauth": {
            "type": "oauth2",
            "tokenUrl": "https://example.com/v5/locations/token",
            "flow": "application",
            "scopes": {}
        }
    },
Solved Solved
0 17 1,480
1 ACCEPTED SOLUTION

So we are also using client_credentials but the piece where they try it out in our dev portal we are using a customtoken so if they want to try it out all request look like they are coming from the same token that we generated. After they try it out if they they want to register they register and they will get a consumerKey and consumerSecret which can be used to generate a valid token needed to hit our sandbox environment.

View solution in original post

17 REPLIES 17