Hi Edit,
The client id and secret are already sent as body parameters, because the default http method to get the access token is POST.
Ok, but it still doesn't seem to be working...
The client id and secret are already sent as body parameters, because the default http method to get the access token is POST.
'grant_type': 'authorization_code' is not needed as an additional parameter, it is added automatically.
.responseType("code") is also the default
I removed those, no change...
I see that the deeplink method name is missing, then the last part of your redirect url is "deeplink_svy_oauth" (please check the docs of builder.deeplink())
Did you configure in your app the redirect url to end with deeplink_svy_oauth (where you also have the client id and secret)?
I am not specifying a 'deeplink' & have configured app with the deeplink_svy_oauth at the end (& this is how I got the Intuit QuickBooks OAuth to work)
What error do you get when running your code?
- Code: Select all
ERROR plugin.oauth - Could not set the oauth code {"error":"invalid_client","error_description":"Parameter 'client_id' and/or 'client_secret' are invalid."} com.github.scribejava.core.model.OAuth2AccessTokenErrorResponse: {"error":"invalid_client","error_description":"Parameter 'client_id' and/or 'client_secret' are invalid."}
at com.github.scribejava.core.extractors.OAuth2AccessTokenJsonExtractor.generateError(OAuth2AccessTokenJsonExtractor.java:75) ~[scribejava-core.jar:?]
at com.github.scribejava.core.extractors.OAuth2AccessTokenJsonExtractor.extract(OAuth2AccessTokenJsonExtractor.java:46) ~[scribejava-core.jar:?]
at com.github.scribejava.core.extractors.OAuth2AccessTokenJsonExtractor.extract(OAuth2AccessTokenJsonExtractor.java:16) ~[scribejava-core.jar:?]
at com.github.scribejava.core.oauth.OAuth20Service.sendAccessTokenRequestSync(OAuth20Service.java:39) ~[scribejava-core.jar:?]
at com.github.scribejava.core.oauth.OAuth20Service.getAccessToken(OAuth20Service.java:73) ~[scribejava-core.jar:?]
at com.github.scribejava.core.oauth.OAuth20Service.getAccessToken(OAuth20Service.java:68) ~[scribejava-core.jar:?]
at com.servoy.extensions.plugins.oauth.OAuthService.setAccessToken(OAuthService.java:112) ~[oauth.jar:?]
at com.servoy.extensions.plugins.oauth.OAuthServiceBuilder.lambda$buildWithCallback$0(OAuthServiceBuilder.java:351) [oauth.jar:?]
at com.servoy.extensions.plugins.oauth.OAuthServiceBuilder$$Lambda$1093/0x000000001fee1990.run(Unknown Source) [oauth.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
at java.lang.Thread.run(Unknown Source) [?:?]
ERROR Could not set the oauth code
The last line is from the callback method that is like your code above (I used the sample plugin code)...
Or do you want to use the client credentials grant type? That is not implemented by the plugin.
I don't.
As I mentioned, I got the equivalent error in Postman app when it was configured to send 'Basic Auth Header'...
Thanks
Rafi