go-saml | A just good enough SAML client library written in Go | Authentication library
kandi X-RAY | go-saml Summary
kandi X-RAY | go-saml Summary
A just good enough SAML client library written in Go.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of go-saml
go-saml Key Features
go-saml Examples and Code Snippets
Community Discussions
Trending Discussions on go-saml
QUESTION
I am using go-saml library in our project to enable SSO in which the service provider will be Salesforce and Identity Provider will be the Golang code. Golang code will first verify the user then it will create a SAML response to allow the user to login to Salesforce. I am new to Golang and following Creating a SAML Response (if acting as an IdP) of this library. So, far I am able to create a SAML response using it but facing some challenges in customizing it as per the requirement.
- The first challenge I was facing is to add AudienceRestriction in the Conditions block as below:-
https://saml.salesforce.com
I have tried to add it like below in the code, but it seems AudienceRestrictions is not defined in Conditions object.
authnResponse := saml.NewSignedResponse()
authnResponse.Conditions.AudienceRestrictions = "https://saml.salesforce.com"
I don't find any way to add the above block in the Conditions block which is mandatory for Salesforce. Please suggest me some way to do so.
- I also have to add AuthnStatement below the conditions block as below:-
urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified
- Even after manually adding the above blocks in the SAML response, I am getting the below error while validating the SAML response using the Salesforce SAML validator
Validating the Signature... Is the response signed? true
Is the assertion signed? false
The reference in the response signature is valid
Is the correct certificate supplied in the keyinfo? trueSignature or certificate problems
The signature in the response is not valid
I have generated a Public key(self-signed .pem certificate) and a Private key. After that, I have uploaded the public key to the Salesforce and using private and public keys to inside the code for generating SAML response. I have no idea why I am getting Signature Invalid error. Please let me know if you have any suggestions for me.
In case you want to check my Golang code - https://play.golang.org/p/U9dXZblTHG1
...ANSWER
Answered 2020-Mar-23 at 19:01- Audience can be added via a provided function:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install go-saml
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page