0

Is it possible? I'm trying to do it but had some errors

My steps where:

1) Create the app in the Developer Center. On the Application URL I left the suggestion https://api.getgo.com (I guess this could be an issue, do I have to fill this with a custom url? Maybe one that the named credential generates?) details of the app in Developer Center 2) Create an OpenID auth provider OpenId auth provider Details with salesforce configuration urls

3)Create Named Credential with identity : type "Per user" authentication protocol " Oauth 2.0", the authentication provider I made in step 2) and with Generate Authorization Header, Allow Merge Fields in HTTP Header, Allow Merge Fields in HTTP Body checked

named credential details

When I try to start the authentication flow I get the error:

{"error":"invalid_request","error_description":"Required parameter(s) missing or wrong."}

From the following url request:

https://api.getgo.com/oauth/v2/authorize?response_type=code&client_id={consumerkey}&redirect_uri={salesforce sandbox url}%2Fservices%2Fauthcallback%2FgotoWebinar&state={big encoded key}

If I change the url in the Developer Center app (img in step 1) I got different errors pages in step 3)

Do you know if this is possible? I already made a connection with httpRequest and apex, But I wanted to improve that solution if possible, because with new the oauth v2.0 I have to save the refresh token and I have different issues with this (mostly the way the app is working now and the refactor that I have to make to save the refresh token because of dml limitations)

There is an underlying question and that is what's the best way to connect to a G2W app?

Thanks!

Update: I was able to authenticate, in step 2 I ticked the "send client credentials in Header" and In the app I put the callback url given in that step. With those changes in the app provider it worked. But it's only work for an hour, then I'm starting to get a 403 Forbidden "int_err_code":"InvalidToken","msg":"Invalid token passed" So named credential is not handling the refresh token, and i'm guessing it's because it is handled if the api response status is 401. (in scope I have "refresh_token full" and I actually test with "openid refresh_token full" too

  • What merge fields are you expecting to actually pass to GoTo? Will they be in the Header of the request, the Body or both? You have all 3 checked is why I ask and the error message seems to indicate a parameter is missing. Did you provide a certificate name in your setup? You'll need one and that could be what's missing in your setup. You'll also need to set the Scope. – crmprogdev Mar 2 at 19:08
  • @crmprogdev thanks for all the questions. I think I will not use any merge field at all actually, but checked that just in case. I unchecked them now. I also made a self signed certificate and assign it to the auth provider and I filled the scope with refresh_token (i can use full and refresh_token? I just put the two of them with a space?) I'm still having the same screen at the end, but If I delete the redirect_uri from the url I get redirected to got the code to start the flow of the access_token in gtw. I'm still confused how can start the flow here. – djpeluca Mar 4 at 13:02
  • I was able to authenticate, in step 2 I ticked the "send client credentials in Header" and In the app I put the callback url given in that step. With those changes in the app provider it worked. But it's only work for an hour, then I'm starting to get a 403 Forbidden "int_err_code":"InvalidToken","msg":"Invalid token passed" So named credential is not handling the refresh token, and i'm guessing it's because it is handled if the api response status is 401. (in scope I have "refresh_token full" and I actually test with "openid refresh_token full" too – djpeluca Mar 7 at 14:11
0

Will Answer for anyone who is struggling with this. I could make it work but with workarounds.

First of all when creating the Auth Provider (Step 2 in my original post) Send "Client Credentials in header" should be checked too.In Default Scopes I have "openid refresh_token all" I think openid is not necessary but didn't check that yet, I also didn't check if those scopes ment to be added there or just in the named credential. The rest works as is.

Then in the GTW App (Step 1 of my original post) you should change the Application URL for the Callback URL that the Auth provider salesforce configuration gives you (at the bottom of image 2)

Last but not least, for the named credential you should create a certificate, then select Named principal or per user whatever you case is. Then in scope again "openid refresh_token all" In the callout options just check Generate authorization headers and that should work BUT...

Named credentials works fine with refresh tokens when they got a 401 status response and GoToWebinar Api doesn't give you that, it gives you a 403 when the access token is expired (https://goto-developer.logmeininc.com/getgo-api-http-status-codes)

So You are pretty much done unless you change the named credential URL to just api.getgo.com and then check your calls for 403 responses, make a dummy call forcing a 401 ( any request to /oauth/v2/token with bad token will give you that status and then make the original call again because Named credential refreshed the token automatically after that forced 401.

It's hacky but it works. Hope some of you find this useful

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.