apps-script-oauth2
apps-script-oauth2 copied to clipboard
The OAuth 2.0 Client supports client authentication method 'client_secret_basic', but method 'client_secret_post' was requested.
Hey folks, I'm trying to set this up to use it with Marvel Strike Force's API (mobile game) but I can't make it work. I keep getting this error when I'm redirected back from their login page.
Google Apps Script Error: Error retrieving token: invalid_client, Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method). The OAuth 2.0 Client supports client authentication method 'client_secret_basic', but method 'client_secret_post' was requested. You must configure the OAuth 2.0 client's 'token_endpoint_auth_method' value to accept 'client_secret_post'. (line 553, file "Service")
I'm not sure how to fix it, I read through the documentation and tried a couple of things but nothing worked. This is how my service setup looks like:
function getOAuthService() {
return OAuth2.createService('MSF')
.setAuthorizationBaseUrl('https://hydra-public.prod.m3.scopelypv.com/oauth2/auth')
.setTokenUrl('https://hydra-public.prod.m3.scopelypv.com/oauth2/token')
.setClientId('xx')
.setClientSecret('xx')
.setScope('m3p.f.pr.inv openid offline')
.setCallbackFunction('authCallback')
.setCache(CacheService.getUserCache())
.setPropertyStore(PropertiesService.getUserProperties());
}
Link to their "doc", there's not much in there: https://developer.marvelstrikeforce.com/beta/index.html
Not sure if I'm missing sometime or if the library is just incompatible with their API, any help is appreciated. Thank you!
Is there a way to change 'token_endpoint_auth_method'? I tried with .setParam but still the same error.