Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SAML to README #110

Merged
merged 1 commit into from
Sep 20, 2023
Merged

Add SAML to README #110

merged 1 commit into from
Sep 20, 2023

Conversation

hcjulz
Copy link
Collaborator

@hcjulz hcjulz commented Sep 20, 2023

No description provided.

Copy link
Contributor

@austingebauer austingebauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

README.md Outdated
Comment on lines 239 to 262
// Create a new saml config providing the necessary provider information:
cfg, err := saml.NewConfig(<entityID>, <acs>, <metadata>, options...)
// handle error

// Use the config to create the service provider:
sp, err := saml.NewServiceProvider(cfg)
// handle error

// With the service provider you can create saml authentication requests:

// Generate a saml auth request with HTTP Post-Binding
template, err := sp.AuthRequestPost("relay state", options...)
// handle error

// Generate a saml auth request with HTTP Request-Binding
redirectURL, err := sp.AuthRequestRedirect("relay state", options...)
// handle error

// Parsing a SAML response:
r.ParseForm()
samlResp := r.PostForm.Get("SAMLResponse")

response, err := sp.ParseResponse(samlResp, "Response ID", options...)
// handle error
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation looks a bit off?

@hcjulz hcjulz merged commit e0aaca8 into saml-lib Sep 20, 2023
@hcjulz hcjulz deleted the saml-lib-readme branch September 20, 2023 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants