From 6df0b9f677984a85cc50fa964c4ead461f0a3063 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Fri, 31 Oct 2014 00:30:39 +0530 Subject: [PATCH] SAMLUtils: SAML user id should fit within the UUID VARCHAR(40) column Signed-off-by: Rohit Yadav --- utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java b/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java index 36c4d0f90c4..d129309ba98 100644 --- a/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java +++ b/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java @@ -102,7 +102,8 @@ public class SAMLUtils { public static final String CERTIFICATE_NAME = "SAMLSP_CERTIFICATE"; public static String createSAMLId(String uid) { - return SAML_NS + uid; + String samlUuid = SAML_NS + uid; + return samlUuid.length() > 40 ? samlUuid.substring(0, 40) : samlUuid; } public static Boolean checkSAMLUserId(String uuid) {