auth0/node-samlp

getAttributeType() of saml20 could be made more specific for number data type

yesvivek opened this issue · 0 comments

Currently getAttributeType() of saml20.js is sending out all number type as double; can this be modified to send "integer" type too?

Something like,

function getAttributeType(value){
  switch(typeof value) {
    case "string":
      return 'xs:string';
    case "boolean":
      return 'xs:boolean';
    case "number":
      if(value === parseInt(value, 10))
        return 'xs:integer';
      else
        return 'xs:double';
    default:
      return 'xs:anyType';
  }
}