Zoom Oauth App for Salesforce - No_Oauth_State: State was not sent back - how to pass through state?

Description
We are trying to replace our JWT App before the June deadline. I’ve created an Oauth App and set it up so that it redirects to Salesforce where we’ve set up a Named Credentials and an Auth Provider so that it can process the access token from Zoom. However I’m running into the error below when I try to add the App.

Error?
No_Oauth_State: State was not sent back

Screen Shot 2023-04-20 at 11.47.10 PM

This error is provided from Salesforce when the redirect URL is followed.

I looked in the docs and I see that State is an optional parameter and I don’t see it in the “Add URL” url provided by the app. How do I set my app up so that it provides this state variable? I tried entering a dummy state variable into the redirect url and then I get the error that state is invalid so I’m not sure what is expected here.

Thanks for any and all help provided!

Hey @will.zoom - I see you commented back on a similar question before (link here)

Can you provide any clarification on what is needed for the state parameter?

Ah perhaps Will is not around anymore - sorry to bother you @elisa.zoom or @donte.zoom - can either of you shine any light on what is expected for the state variable in an Oauth app?

Thank you!

Thanks for the tag, @cmcgloin! The state variable can be any random value as long as the call back URL state variable matches with the salesforce state propagate value. More details on this topic be found in this post:

Let us know if this helps

1 Like

Thank you so much for getting back to me @donte.zoom - I really appreciate it. So the docs you linked indicated that the state variable should be a hash of the session Id. How would I access that from the App UI?

Hey @donte.zoom - can you point me to any help docs on this please? It seems to be a grey area.

@cmcgloin,

What language are you using to implement OAuth? I am happy to get you a code sample to reference for your implementation. Also, please provide a detailed description of the workflow you are looking to implement.

Thanks @donte.zoom . We are doing this in Salesforce so writing it in Apex (essentially Java).

So an example of one of our workflows currently is that we’ll have some records in Salesforce which represent events we will run for our Members. If the meeting has a virtual option, then the user will set up a Zoom meeting and populate the Meeting Id into a field in Salesforce. If that field is populated, then we have coding automation set up which calls out to Zoom, retrieves the information such as dial in information about the meeting and populates it back on to the virtual event meeting.

Currently we use a JWT app for authorizing the callout to Zoom from Salesforce, but moving forward we will have to use the new Oauth apps instead. So as I understand things we’ll do the following:

  1. Authenticate into the Oauth app and get a token
  2. Take the token from the app
  3. Callout to Zoom using the token and get the information about the Zoom Meeting
  4. Retrieve the information and do our Salesforce automation

Does that help clarify what we’re trying to do? I’m not sure how to get the Session ID from Zoom before we authenticate into the App.

Hey @donte.zoom - apologies for the double tag but we’re trying to get this resolved soon. Can you (or any of your esteemed Zoom colleagues) help with this issue please?

Tagging a bunch of leaders in this space - can anyone please help me with this problem? This is the worst developer support system I’ve experienced - I wish we could just create tickets. @carson.zoom, @elisa.zoom, @natalie.zoom, @chunsiong.zoom, @nigel.hughey, @michael_p.zoom, @gianni.zoom

Hi @cmcgloin ,

Can you please confirm referring to the migration guide from Zoom Support so we can better understand where the breakdown is occurring? https://support.zoom.us/hc/en-us/articles/12362230591757-Salesforce-migration-to-OAuth-

Thanks for getting back to me @gianni.zoom - so this for a custom OAuth app, not using the standard Salesforce sync. We are looking to auth and then use the details to complete some other automation within the code.

Would the standard Salesforce app be a better use case for that?

Hi @cmcgloin ,

I believe so! Please try the documented and supported guidance: Configuring Zoom credential settings for Salesforce - Zoom Support

Hey @gianni.zoom - we tried the Zoom app but unfortunately it requires too many custom fields on the Activity object in Salesforce. Due to business needs we will not be able to clear out that many custom fields for the Zoom app to be used.

Can you please try and clarify how we can pass through a state variable when setting up an OAuth app? I don’t see anything in the setup guide but I know I must be missing something simple. Thanks!

Are you adding state as the auth url query parameter as opposed to the redirect URL? See this post for context: