Speaking as someone who has built a SAML
IdP from scratch, building one in Java mainly involves these things:
- Server application that listens for SAML requests, usually on port 443. You could use spring-boot for this.
- Server code to present authentication pages to users the IdP manages. LDAP is a much used way of authenticating a user.
- Server code to extract attributes for the authenticated user. This could be an LDAP lookup to find attribtes such as first name, surname, email etc.
- Server code to decide which attributes can be released to the requesting SP. You would use the SP's
entityID
for this.
- Server code to translate user attributes (e.g. from LDAP) to SAML attributes and send to the SP.
1 and 4 require parsing and creating SAML
. You can use openSAML for those.
5 requires a SAML
attribute schema the SP is likely to understand. You can use eduPerson for this.
Working with SAML
and an SP requires a knowledge and implementation of various SAML
profiles. Web Browser SSO is one that is used a lot. You can read about the profiles here.
Once you understand SAML
and where it fits in the process you need to understand/implement XMLSignature and various encryption topics using PKI.
Once you have a working, tested IdP implementation, you then need to be able to parse SAML Metadata (PDF) to validate an SP using its public key certificate and various other urls in its metadata. You also need to keep the SP metadata up to date, as well as creating the IdP metadata to send to the SP so it can validate your SAML
Response
, which you will sign.
If the ROI isn't worth that amount of development, you can use the 'standard' IdP.