Skip to navigation

Set up OAuth 2.0 Authorization Code for an HTTP connector

View as Markdown

OAuth 2.0. Use the Authorization Code Grant when an integration needs to access a connected system with each user’s permissions. The user signs in and grants access, then Moveworks exchanges an authorization code for tokens that represent that user. For other grants, see Choose a grant.

This guide applies to HTTP connectors used by plugins and by custom MCP servers that do not support Dynamic Client Registration (DCR).

How Authorization Code works

The authorization server handles sign-in and consent. Moveworks receives an authorization code, exchanges it for tokens, and uses the access token when the integration calls the connected system. The diagram shows the recommended flow with PKCE using a SHA256 challenge.

Create a verifier and SHA256 challenge Send authorization request and challenge Ask the user to sign in and consent Approve access Return an authorization code Exchange the code and verifier Return access and refresh tokens Send a request with the user's access token User Moveworks Authorization server Connected system

Proof Key for Code Exchange (PKCE) protects the authorization code from interception. The client secret authenticates the connector to the authorization server. These controls solve different problems, and a provider may require both.

Before you begin

Confirm that:

  • You can create HTTP connectors in Tool Studio.
  • You can register an OAuth application with the connected system’s authorization provider.
  • The provider supports the Authorization Code Grant.
  • You have the system’s base URL, authorization URL, token URL, required scopes, and any provider-specific parameters.

Register the callback URL

Register the callback URL for your Moveworks data center in the provider’s OAuth application. Replace <org> with your Moveworks organization name.

Data centerCallback URL
United States (default)https://<org>.moveworks.com/auth/oauthCallback
Canadahttps://<org>.am-ca-central.moveworks.com/auth/oauthCallback
EUhttps://<org>.am-eu-central.moveworks.com/auth/oauthCallback
Australia and Asia Pacifichttps://<org>.am-ap-southeast.moveworks.com/auth/oauthCallback
Government Secure Cloudhttps://<org>.moveworksgov.com/auth/oauthCallback
Japanhttps://<org>.jp.moveworks.com/auth/oauthCallback
UKhttps://<org>.uk.moveworks.com/auth/oauthCallback
US Prod 4https://<org>.prod4.us.moveworks.com/auth/oauthCallback
US Prod 3https://<org>.prod3.us.moveworks.com/auth/oauthCallback

To find your organization name, open Tool Studio and copy the base URL. Your organization name is the subdomain. For example, the organization name in https://acme.moveworks.com is acme.

Moveworks adds the callback URL

Moveworks automatically includes your organization-specific callback URL in the authorization request. Do not add a custom redirect_uri query parameter unless Moveworks instructs you to do so. If you select Has the oauth app been configured with a generic redirect URL, Moveworks sends the generic My Moveworks callback instead, so register that URL with the provider. Leave it cleared to use the URL in the table.

Configure the HTTP connector

1

Start creating the connector

Create an HTTP connector and fill in its details up to Auth Config. Users see Display Name (Optional) and Display Description (Optional) when they’re asked to grant access, so use the system name they recognize, such as Workday or Salesforce, and a short description of the access the integration requests.

2

Choose Authorization Code Grant

Set Auth Config to Oauth2, then set Oauth2 Grant Type to Authorization Code Grant.

The Auth Config field set to Oauth2 and the Oauth2 Grant Type field set to Authorization Code Grant.
Choose Oauth2 and Authorization Code Grant.
3

Enter the required OAuth settings

Use the values from the authorization provider:

FieldWhat to enterWhy it matters
Authorization URLThe provider’s authorization endpoint.Sends users to the provider to sign in and grant consent.
Client IDThe client ID from the OAuth application you registered.Identifies the application requesting access.
Client SecretThe client secret from the registered OAuth application. Leave it empty when the Moveworks On-Prem Agent holds the secret.Authenticates the connector when it exchanges the authorization code.
Authorization Code Grant ScopeA space-separated list of the scopes the integration needs.Limits the data and operations the integration can access.
Oauth2 Token UrlThe provider’s token endpoint.Exchanges the authorization code for access and refresh tokens.
4

Configure PKCE when required

Under PKCE code challenge method, select SHA-256 (S256) unless the provider rejects PKCE. If you leave both options cleared, Moveworks sends no PKCE challenge. Select Plain only if the provider supports PKCE but not S256.

Required for OAuth-protected MCP servers

Under PKCE code challenge method, select SHA-256 (S256) · Recommended for an OAuth-protected MCP server. Do not select Plain · Legacy for this connection path.

PKCE code challenge method with SHA-256 (S256) · Recommended selected.
Select SHA-256 (S256) · Recommended for an OAuth-protected MCP server.
5

Save the connector

Review the values, then save the connector. If you edit it later, saved secret values appear blank. Leave a secret field blank to keep the current value, or enter a new value to replace it.

Parameters Moveworks adds automatically

Moveworks adds response_type=code, your organization-specific redirect_uri, and a randomly generated state value to the authorization request, plus scope and the PKCE challenge from your settings. Do not add these values under additional request data or query parameters. If your provider needs access_type=offline to issue a refresh token, as Google does, add it under Authorization Request Query Parameters.

Configure token revocation when the provider supports it:

  • Revoke URL: Enter the provider’s token revocation endpoint.
  • Instructions URL (Optional): Enter a user-facing page that explains how to revoke access when automatic revocation fails.
  • Revocation token key: Use the request field expected by the provider. The default is token.
  • Revocation authentication and headers: Match the provider’s requirements.

Some providers require additional authorization query parameters, token-request data, headers, or certificates. Configure these fields only when the provider’s documentation or Moveworks requires them.

Common examples include:

  • An audience, prompt or access_type=offline authorization query parameter.
  • Additional token-request data sent as application/x-www-form-urlencoded.
  • Additional request headers or common query parameters.
  • X.509 certificates, private keys, or a CSRF endpoint.

Do not manually add state, response_type or redirect_uri. Moveworks adds them automatically. API calls always send the access token as Authorization: Bearer <token>; this grant doesn’t use Header Auth Key or Header Auth Value Pattern.

Route calls through the On-Prem Agent

The Moveworks On-Prem Agent can handle token exchange, refresh, revoke, and API calls for this connector from inside your network. The agent encrypts each employee’s access and refresh tokens before they leave your network, and Moveworks stores only the encrypted form. The employee’s browser still opens the Authorization URL directly.

This route requires:

  • Agent 2.11.0 or later, with a user_rest_configs entry for the system and at least one key in encryption_keys.
  • On-premise OAuth agent routing enabled for your organization by Moveworks. Without it, saving a connector that names an on-premise service fails with “On-premise OAuth agent routing is not enabled for this org.”

Set these fields on the connector:

FieldWhat to enterWhat it does
On-Premise Service NameThe service name of the agent’s user_rest_configs entry, for example JIRA. Matching is case-insensitive, and surrounding spaces are trimmed.Routes token exchange, refresh, revoke, and API calls for this connector through the agent that holds this service name. The form does not check the name against the agent, so a mismatch surfaces at runtime as a “not configured” error from the agent.
On-Premise Encryption Key IDThe key ID of an entry in the agent’s encryption_keys, for example 1.Tells Moveworks which agent key encrypts the tokens. Moveworks stores only encrypted tokens and sends them to the agent to decrypt for each call. Requires On-Premise Service Name.
Client SecretLeave empty when the agent holds the client secret.The agent adds its own client secret on token exchange, refresh, and revoke calls. A value entered here is also stored by Moveworks.
Create a new connector for the encrypted flow

To move an existing connector to agent-side encryption, create a new connector. Tokens stored under the previous format cannot be unlocked by the agent. Delete the old connector after the new one works.

Validate the connector

Authorize the connector, then validate the path that uses it.

Open an action, event, path, or query that uses the connector. Test the request in the HTTP editor and confirm that the connected system returns the expected response with the test user’s permissions.

If validation fails, check the callback URL, authorization and token URLs, client credentials, scopes, PKCE selection, and any provider-specific parameters. For a connector routed through the On-Prem Agent, an agent log error of the form user auth connector [NAME] not configured. Available connectors are [...] means On-Premise Service Name does not match any user_rest_configs service on the agent.

What users experience

When an integration needs user authorization, Moveworks checks the required connectors before it runs:

  1. If the user has a valid token, the integration continues.
  2. If the user has not authorized the connector or the token is invalid, the assistant asks the user to grant access.
  3. The user opens the authorization link and signs in with the connected system.
  4. The user grants consent and returns to the assistant.
  5. Moveworks resumes the original request automatically.
A user asks the Moveworks assistant to close an Asana task, signs in to Asana and allows access, and the task is then marked complete in Asana.
A user authorizes an integration and returns to the Moveworks assistant.

Moveworks preserves the original request for 30 minutes while the user completes authorization. After 30 minutes, the user must make the request again.

If an integration requires authorization for multiple connectors, the assistant presents them together and shows the user’s progress. The integration runs after the user authorizes every required connector.

Limitations

Notify actions (for example, approval workflows that send a message and wait for a response from another user) are not supported with preflight check. If your plugin uses a notify action, the preflight check and auto-restart behavior described above will not apply. This is a known limitation.

My Moveworks SSO is required

Add every user who needs to authorize an integration to My Moveworks SSO. This gives users access to the connections page where they grant consent. It does not give them access to admin or developer products without the corresponding roles. Use the SSO documentation to configure access.