Azure AD authentication - code parameter too long ?

Hello to All,

I'm still new in the OS platform, and I have a question that I hope someone can help me. I'm using Microsoft Login Connector for authentication and when I receive the response from Azure (code and state parameters), the browser always gives the following error without never going to the preparation of the CallBack page:

The URL looks like this:

https://rmpp.outsystemscloud.com/MicrosoftLoginConnector/AzureADResponse.aspx?code=AQABAAIAAAAP0wLlqdLVToOpA4kwzSnx1NduoTHlU0qzV5z4DMyQdLEA8yMSb8kcn90WkxIa0-XLONT1HM-AbnqyZ1H6cAUyS0718q63pMLyAZ7ATTFoh5R2IV_dECGVVO4C7PkYpX1IAhb0j_NVN3jz5kPdN4rpjqXtiUAy1EwVG05Fx_ak6ahmg7lOn6GVugL_U1-dnUFm-bhzcKtOwZX7I0UJOiYuHjReEdIf8q5KoQHqjLeBoaEVDY9L04JdyqdZsXR3vr9Uhd8Kf2I1FlRPz2gS0LmFUs7-4k2-PHOZaae6rQKS2s3CgQ0_9xCV5t8dOSlvphdoSyCV4nzHAu9ujCtWKUB8pzQysTA0BNFM_FSP6n0Qy-z_ji1Ax1DwCKqlkdLKLZ2TS4Fmod9c0bRy5QKeWP1xurH9yZogdjeSEKvbkvdzB6Opur361TOiTWw5JJ6zF7dqBX195uyQbnleeFhjjFl_OVFc7st20ogpYrqMPY9aaGWpjsW7hTX02RMiJKmnlicJySYljGTK0qFBnVyDocPPAhS3OAhX9nrrYQJ5n_F8qqAQ1ugH7juuOv9lpwPtviTI2AzpyqUyRS8jWkvj56e66Fdj4_WcFVoGGVnM8IV6jVmZhDF2nxld0ApsfjVTYGUOjQSgJBG7w7wX6K1rLT7MFavR9Fm4Kbdoo4Uv3J8kCJrVAys7MUcuZ6lYitzJeW7IhmRjdUFIw1MGeWEKxesT6q6OgmgAKk0-95XGS3qf-jY-MaMk4Rte9bD07K1IjIjMDj7c0MopTBDSsSR-M-2y8VBIqnu0vvoDzwghSCnsAlLdSvqV9Edsz5X4L8nFeUkOMJZ8v3mosNhpA1v5_54V-EcKw3M4mT_gVSxR_b1JEJ4lSWqcuQy_aSU_3IPsAomQaqqesF5dFWO89jN0dN9sSu2VQJr6A29neHDxEJhQE_H-2dafI6EprHxXQeWcgboyqQH_zQg7kpPN2VORvf2buBHNSZcCZA1MczZMxBI_boBiREmatR_dS0O8n3CAdbraZdDp1Fxl06JyQZfMasN0dYOEwJ240hJwkBJP_RwkD55oPhD1H5cRMSaM3nk1raQBYoIvDAj8wIYekURBV--lctdV__HQVhQd3uF-m5nxYaFko8REHnPVj1O7XrVNqN94y63zXLLqxUvSUWWujXkMKJmSc2vhIQ9ckcZ0ccsmjd8j60RJUh04yz0i9lglLZ4gAA&state=07b4cc29-e1b4-4062-9aa7-b6a5ed125e49&session_state=81abe640-55cb-4f60-bafb-9d0f0ee39a19

If I change the value of code parameter to a shorter string (ex: "dfdfhdj") and hit ENTER, the page loads and preparation starts. Any idea what's wrong ?

Thank you in advance.

Best Regards,

Ricardo Pereira


I had the same problem. First check if the callback url in azure and in your application is exactly the same.

And more thing, when u click on authenticate button in your web app, is it going to microsoft auth login? And from there r u able to login with your Microsoft credential?

I think in your azure AD app you set the call back page as AzureADResponse.aspx where as in your aplication the is no page like this. Can you check it?

Sourav Pasari wrote:

I think in your azure AD app you set the call back page as AzureADResponse.aspx where as in your aplication the is no page like this. Can you check it?

Hi Sourav,

Thank you for your reply.

Yes, the page exists. The problem is really on the code parameter value (too big ?) because when the browser opens trying to open the page and then fails giving the error I described, if I substitute the code value by another small string instead and press F5 to reload the page, the preparation of the page starts, so, the page have the correct name.

Really strange this situation.

Best Regards,

Ricardo Pereira


Hi All,

Any ideias anyone ?

Still haven't solved this issue. Thank you.

Best Regards,

Ricardo Pereira


Ricardo Manuel Pedrosa Pereira wrote:

Hi All,

Any ideias anyone ?

Still haven't solved this issue. Thank you.

Best Regards,

Ricardo Pereira



Hi Ricard,

In my case, I had to open a ticket with the OutSystems support to increase the maxRequestLength value (in this case the new value was 131072). If you are running on premises you can do it yourself or ask who can do it.


Regards,

AP

Hi António,

Thank you for your response.

Yesterday I opened a case to Outsystems Support. Waiting for their answer.

I'm in a personal environment. Already tried to change that value because of this article:

https://www.saotn.org/the-length-url-request-exceeds-configured-maxurllength-value/

also used module "Factory Configuration" to try to change that value (since I don't have access to IIS) with no sucess also.

So the problem remains.

I'm using now Fiddler to see if I can get some answer.

Anyway, if someone get the answer hope you can share with us.

Thank you.

Best Regards,

Ricardo Pereira