Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Truncation of Large IDP Metadata in SAML IdP Metadata-field #13226

Closed
2 tasks done
hogemo opened this issue Jun 29, 2023 · 7 comments
Closed
2 tasks done

Truncation of Large IDP Metadata in SAML IdP Metadata-field #13226

hogemo opened this issue Jun 29, 2023 · 7 comments
Assignees

Comments

@hogemo
Copy link

hogemo commented Jun 29, 2023

Debug mode

Describe the bug

I'm encountering an issue with the SAML IdP Metadata-field when handling large IDP metadata files. Despite the metadata file from our IDP provider being valid, it's getting truncated to around 65,000 characters when I attempt to insert it into the SAML IdP Metadata-field. This behavior persists regardless of whether I directly paste the XML data or insert the URL linking to it. This truncation causes information loss and hinders proper function.

Possible solutions would be to increase the character limit of the SAML IdP Metadata-field.

Any assistance or suggestions on how to handle large IDP metadata files without truncation would be greatly appreciated.
Thank you for your time and attention.

Reproduction steps

  1. Paste or insert URL to IDP metadata
  2. Save (everything look good - green success message)
  3. Looking back into the metadata text-field it is truncated, and when pressing save again, it is not possible because the xml is corrupt.
    ...

Expected behavior

No truncating

Screenshots

No response

Snipe-IT Version

v6.1.1-pre - build 10653 (master)

Operating System

Debian 11

Web Server

Apache

PHP Version

7.4.30

Operating System

No response

Browser

No response

Version

No response

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

Below the metadata-field it says "The Metadata format is invalid." No error message found in debugger, nor in laravel.log.

Additional context

No response

@welcome
Copy link

welcome bot commented Jun 29, 2023

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@uberbrady
Copy link
Collaborator

I suspect the right solution here is to change to a larger TEXT blob format, probably with a migration.

@uberbrady
Copy link
Collaborator

MEDIUMTEXT ought to do it - that'll let you store up to 16MB of IdP metadata. If you want more than that, you're gonna have a bad time.

@hogemo
Copy link
Author

hogemo commented Jul 5, 2023

MEDIUMTEXT ought to do it - that'll let you store up to 16MB of IdP metadata. If you want more than that, you're gonna have a bad time.

Hmm okay, how would i do that? In the db?

@snipe
Copy link
Owner

snipe commented Jul 5, 2023

@paegelow give me a few - I'll add a migration and then you can run the upgrade.

@snipe
Copy link
Owner

snipe commented Jul 5, 2023

You should be able to run the upgrade script now and the field should be changed to a MEDIUMTEXT field

@snipe snipe closed this as completed Jul 5, 2023
@hogemo
Copy link
Author

hogemo commented Jul 6, 2023

You should be able to run the upgrade script now and the field should be changed to a MEDIUMTEXT field

It worked! Really appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants