OAuth 2.0 Authorization Code

Configure delegated user authorization for an HTTP connector.
View as Markdown

Use the OAuth 2.0 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.

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.

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 Start

Confirm that:

  • You can create HTTP connectors in Agent 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 Agent 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.

Configure the HTTP Connector

1

Create an HTTP connector

In Agent Studio, open HTTP Connectors and create a connector.

HTTP Connectors page in Agent Studio.
Open HTTP Connectors in Agent Studio.
Control for creating an HTTP connector in Agent Studio.
Create an HTTP connector.
2

Enter the connector information

Complete the connector fields:

FieldWhat to enterWhy it matters
Connector NameA stable internal name. You cannot change it after you create the connector.Identifies the connector in Agent Studio.
Display NameThe system name users recognize, such as Workday or Salesforce.Appears to users during authorization.
Display DescriptionA short description of the access the integration requests.Helps users understand what they are authorizing.
Base URLThe base URL for the connected API or MCP server.Sets the destination for requests that use the connector.
3

Choose Authorization Code Grant

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

HTTP connector authentication settings with OAuth2 and Authorization Code Grant selected.
Choose OAuth2 and Authorization Code Grant.
4

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.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.
5

Configure PKCE when required

Follow the authorization provider’s PKCE requirements.

Required for OAuth-protected MCP servers

Select PKCE using SHA256 code challenge for an OAuth-protected MCP server. Do not select the plain code verifier for this connection path.

Authorization Code Grant PKCE Algorithm with PKCE using SHA256 code challenge selected.
Select PKCE using SHA256 code challenge for an OAuth-protected MCP server.
6

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, access_type=offline, and a randomly generated state value to the authorization request. Do not add these values under additional request data or query parameters.

Configure token revocation when the provider supports it:

  • Revoke URL: Enter the provider’s token revocation endpoint.
  • Instructions URL: 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, certificates, or custom token formatting. Configure these fields only when the provider’s documentation or Moveworks requires them.

Common examples include:

  • An audience or prompt authorization query parameter.
  • Additional token-request data sent as application/x-www-form-urlencoded.
  • A custom authorization header name or token value pattern.
  • Additional request headers or common query parameters.
  • X.509 certificates, private keys, or a CSRF endpoint.

Do not manually add state, response_type, redirect_uri, or access_type. Moveworks adds them automatically.

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.

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 granting an integration access from the Moveworks assistant and returning after authorization.
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.

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.