Text too long for this field (MS Login - oAuth 2.0)

I’m having an error when a ms user is admin to azure ad directory and try to login via ms in my bubble app. But if the ms user is not admin then there is no problem with the ms login. Btw I use API connector OAuth2 User-Agent-Flow

1 Like

I am experiencing the same issue - and it has just recently started to occur.

1 Like

When an Azure AD admin account authenticates, it often pulls additional claims—especially if the account is assigned to multiple groups or roles—resulting in a larger token or user profile response. Because Bubble may automatically save or parse this response, a “text too long” error can appear for admin accounts but not for “normal” user accounts.

I’m not sure if this is entirely correct—it’s just a thought.

1 Like

I’ve solved my issue:

  1. Changed the email of the impacted user to another email I own (non-admin)
  2. Reconnected MSFT for that user with debug mode on
  3. Got the ‘api successfully reconnected email’
  4. Switched the users email back to the original
  5. reconnected MSFT again
  6. It worked
1 Like

can you elaborate this? Did you use the API connector OAuth userflow agent?

1 Like

Issue has returned :frowning:

1 Like

I’ve the same issue here and that’s complicate du manage mslog with and hazardous bug. Do you think contacting bubble support can be efficient ?

1 Like

It also appear for normal accounts

1 Like

The problem arises when a user has multiple groups and roles assigned, which can lead to complications such as larger token sizes or increased user profile data. This might affect processing or cause errors in systems that handle authentication data

1 Like

Hi,

We’re encountering the same error related to token size. Bubble appears to have a hard limit of 2,000 characters for the return token. This is a platform limitation and ideally should not exist.

On our end, we’ve reviewed the Azure AD token configuration—it’s minimal, with no optional claims or additional settings applied. Most users are able to log in without issue. However, two admin users with identical profile scopes are seeing inconsistent behavior: one can log in successfully, while the other consistently encounters this error.

If you’re experiencing this issue as well, we strongly recommend reporting it to Bubble as a bug. The more visibility this gets, the more likely it is that Bubble will prioritize removing this legacy constraint.

Thank you,
Gilles

1 Like

Hi,

I am currently experiencing the same problem (“Text too long for this field”) with Azure AD + OAuth2 User-Agent-Flow, configured via bubble’s API Connector plugin.

I can contribute to this discussion that, in our case, it has nothing to do with whether or not the user is an Azure AD admin. We created an app for 260 employees of an organization and most of them can sign up and log in with no problems. Others are able to initially sign up but not log in afterwards. And there are also those who cannot even sign up in the first place.

I though that it might have to do with a very long string that I used for the password field during the signup workflow, but replacing this value has had no effect whatsoever.

This problem did not occur for variuos different users while testing in advance of the GoLive of the app. So, we had no chance to discover this before opening v1.0 for all users. This is extremely annoying (to say the least).

bubble Support told me two days ago that they were going to work on it. After following up yesterday, I was assured that our case was marked as a priority. That was 24 hours ago.

I am just hoping that they are indeed working on a solution.

(Update)
FYI: I just tested the following two things, but none of them helped:

  1. change the scope from openid User.Read to openid
  2. delete unnecessary lines from the API response (in API Connector → “Manually enter API response”)
1 Like

Hi everyone - I have solved this problem by setting up a custom OAuth flow directly with Microsoft in the API Connector. This is proving to be a superior solution to Bubbles OAuth flow for a few reasons:

  1. No 2000 character limit reached. Tokens are consistently ~1000 characters.
  2. Ability to sign new users into the app without them first needing to log in via another method and then authenticate with Microsoft.
  3. Ability to integrate with multiple enterprise customer single-tenant Azure environments within the same bubble app (rather than requiring sub-apps).
1 Like

Can you reference documentation on how to set this up?

2 Likes

haha :rofl: @kelly1

@klobassimon is the colleague I was mentioning. He is an expert guy.

2 Likes

I second, if you can provide the steps on how to set this up directly, that would be great.

Breaking out the setup vs login workflows will save a lot of headaches!

Thank you
G

1 Like

Hi @klobassimon,
Same here: if you could share your solution, you would save me (and a lot of other people) a lot of headaches. Your help would be greatly appreciated.

Perhaps suggest you could pay to have that headache cured :rofl:

Yes, I would definitely pay a fair amount to have this issue resolved quickly.
Please contact me if you think you can help me with this.

Hi everyone,

Thanks for the vote of confidence @lindsay_knowcode!

If you need help, please DM me and we can set up a time to meet to see if I’m able to assist. I’m busy running a SaaS company, so not set up like an agency is.

Happy building!