amdonov / lite-idp

Lightweight SAML Identity Provider
Apache License 2.0
210 stars 48 forks source link

Compliant ids #1

Closed ack closed 9 years ago

ack commented 9 years ago

hello! stumbled upon your library and it really helped out. we're using the IdP segment of the code. this patch fixes the ids generated in the saml payloads.

apparently, ids must not start with a number. from http://www.datypic.com/sc/xsd/t-xsd_ID.html :

The type xsd:ID is used for an attribute that uniquely identifies an element in an XML document. An xsd:ID value must be an NCName. This means that it must start with a letter or underscore, and can only contain letters, digits, underscores, hyphens, and periods.

I added a helper protocol.NewID() that will _ prefix the uuids.

Also, included is a patch to the html generated by protocol/post so that firefox works.

amdonov commented 9 years ago

Glad you found the code useful. Thanks for the contribution!