russellhaering / gosaml2

Pure Go implementation of SAML 2.0
Apache License 2.0
326 stars 119 forks source link

How do i generate SP MetaData File Using gosaml2 #82

Open vijay8059 opened 3 years ago

vijay8059 commented 3 years ago

Hi, how do i generate the service provider metadata file that needs to be shared with the IDP

Is there is way that i can generate below meta data file using gosaml2 that needs to share with the IDP

`

MIICvDCCAaQCCQCujMRKGshPODANBgkqhkiG9w0BAQsFADAgMR4wHAYDVQQDDBVteXNlcnZpY2UuZXhhbXBsZS5jb20wHhcNMjEwNzI1MTExODExWhcNMjIwNzI1MTExODExWjAgMR4wHAYDVQQDDBVteXNlcnZpY2UuZXhhbXBsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDruv/Q6k4TZFnG/vDd060iuRviN2yM0J92nXNn2g3c/g3oqiB9eom/1mRUKOeHOhOFjC18m/nOeNss6RXjkWezIuhzYNKP0ABfhCT1pdVOTI8uBag9aXFPYsyRt+mV6qrJ6pNTzYkWpub0dfMuY1XDkW46Zp6YvAf/UVyfGTq0ZkX0WjrrZJOjaYcWajJ73xm5ZZuoX4KTQmbx7ctVkHsKk9SXFnSkaj1iEdqyg2pwGiG89FGhX731O178V5duLzUAh1bLyEKZKAkofpDWQptrdbP9ztbvVYHKj3dtqnYLjQadfMiX3EDV4RKo86CKbFC7NSy/H0gOtkkYhL9R/VtHAgMBAAEwDQYJKoZIhvcNAQELBQADggEBABw9BVBsJpcGGf7W9i+xaFsebb798TomoD2k5vNqJFi3ShpUAsqR4Zc1I9M4lPUPxFBBE+tpD1cVS6QQIfY62ql7ycd50Ma3CejkCW9DuOQ56X6hFIZl6TeZ0vv7T37m3F+URt7SXflRcn8VEQ1UidEc9VOD/E/1zgBkeniXkBXKgh5MYmUMfTF+flacNl1lBVFiibaD32aaVC97EqfdItcnlKvh7fYGiPAWFRoRrcJfKM1nurAt4kNEdpd/QncGQ2etUbkq3tBLczCRUdFKq1YYAmXVnZUZC6PM4+k/IPzR7xEdjZk1FEFNHTwOXLyxo3ZDlHmMcTvWlT93D7DXaqY=

`

mfridman commented 3 years ago

Initialize *saml2.SAMLServiceProvider and then call the .Metadata() method. This returns an entity descriptor you can call xml.Marshal.

Check out similar issue: https://github.com/russellhaering/gosaml2/issues/51