Origin not allowed for redirect_uri" (Error 45011)

If you're seeing this error when trying to connect an account:

400 - Error origin not allowed for redirect_uri for platform:js

What's going on?

During the authentication flow, your app exchanges a code for an access token by calling POST /v3/connect/token. This error means the platform type on your redirect URI is set to JavaScript, which tells Nylas to expect the request from a browser.

If your app actually makes this call from your backend server (which most apps do), the security check fails — and you get this error.

How to fix it

  1. Head over to your Nylas Dashboard
  2. Go to App Settings → Redirect URIs
  3. Find the redirect URI mentioned in the error
  4. Change the platform from JavaScript to Web
  5. Hit Save

That should do it! Your authentication flow will start working right away.

How do I know which platform to pick?

Platform Choose this if...
Web Your server handles the token exchange — this is the most common setup
JavaScript Your app runs entirely in the browser with no backend server

If your app does run entirely in the browser and JavaScript is the right choice, make sure the Origin field in your redirect URI settings matches your app's domain exactly — for example, https://myapp.example.com (no trailing slash, no path).

Still stuck?

We're happy to help! Reach out to Nylas Support with your application ID and redirect URI, and we'll get you sorted.

Updated

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.