saml

package
v0.0.0-...-93dcb33 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateSAMLTimeExpiry

func CalculateSAMLTimeExpiry(responseIssueInstant, assertionIssueInstant time.Time) time.Time

CalculateSAMLTimeExpiry returns the time when a consumed SAML identifier (SAMLResponse or assertion) can be safely deleted, since by then any replay attempt would be rejected as expired. It uses whichever identifier's IssueInstant is most recent plus the allowed delay (crewjam's MaxIssueDelay).

Types

type Client

type Client struct{}

func (*Client) MakeAuthenticationRequest

func (s *Client) MakeAuthenticationRequest(serviceProvider saml.ServiceProvider, idpURL string, binding string, resultBinding string) (*saml.AuthnRequest, error)

MakeAuthenticationRequest abstracts creating an SAML authentication request using the HTTP-Redirect binding. It returns a URL that we will redirect the user to in order to start the auth process.

func (*Client) ParseResponse

func (s *Client) ParseResponse(serviceProvider saml.ServiceProvider, req *http.Request, possibleRequestIDs []string) (*ValidatedResponse, error)

ParseResponse wraps the parsing and validation of the IdP's SAMLResponse in req and returns the verified assertion together with the SAMLResponse's own details in a ValidatedResponse.

type Service

type Service interface {
	MakeAuthenticationRequest(serviceProvider saml.ServiceProvider, idpURL string, binding string, resultBinding string) (*saml.AuthnRequest, error)
	ParseResponse(serviceProvider saml.ServiceProvider, req *http.Request, possibleRequestIDs []string) (*ValidatedResponse, error)
}

Service serves as a lightweight wrapper around the SAML package.

type ValidatedResponse

type ValidatedResponse struct {
	Assertion            *saml.Assertion
	ResponseID           string
	ResponseIssueInstant time.Time
}

ValidatedResponse represents a successfully parsed and validated SAML login: the verified assertion and the SAMLResponse's own ID and IssueInstant

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL