Documentation ¶
Index ¶
- func DownloadIdpMetadata(config *SamlServiceProviderConfig) ([]byte, error)
- func EntityDescriptor(bodyBytes []byte) ([]byte, error)
- func ExtractNameID(assertionXml string) string
- func ExtractSessionIndex(assertionXml string) string
- func GetSessionCache(samlServiceProvider *SamlServiceProvider) *securityprotocol.SessionCache
- func GetSignedAssertions(samlResponse string, cert *tls.Certificate) (string, error)
- type EntitiesDescriptor
- type SamlHandler
- type SamlServiceProvider
- func (a *SamlServiceProvider) CreateLogoutResponse(logoutRequest *saml2.LogoutRequest, w http.ResponseWriter) (int, error)
- func (a SamlServiceProvider) GenerateAuthenticationRequest(w http.ResponseWriter, r *http.Request) (int, error)
- func (a SamlServiceProvider) HandleService(w http.ResponseWriter, r *http.Request, service securityprotocol.HttpHandler) (int, error)
- func (provider *SamlServiceProvider) Metadata() (*types.EntityDescriptor, error)
- func (a *SamlServiceProvider) ParseLogoutPayload(r *http.Request) (*saml2.LogoutRequest, *types.LogoutResponse, error)
- type SamlServiceProviderConfig
- type WrappingSessionCache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadIdpMetadata ¶
func DownloadIdpMetadata(config *SamlServiceProviderConfig) ([]byte, error)
func EntityDescriptor ¶
func ExtractNameID ¶
func ExtractSessionIndex ¶
func GetSessionCache ¶ added in v1.0.9
func GetSessionCache(samlServiceProvider *SamlServiceProvider) *securityprotocol.SessionCache
func GetSignedAssertions ¶
func GetSignedAssertions(samlResponse string, cert *tls.Certificate) (string, error)
Types ¶
type EntitiesDescriptor ¶
type EntitiesDescriptor struct { XMLName xml.Name `xml:"EntitiesDescriptor"` EntityDescriptors types.EntityDescriptor }
type SamlHandler ¶
type SamlHandler struct { RoleAttributeName string AllowedRoles []string Logger *zap.SugaredLogger // contains filtered or unexported fields }
func NewSamlHandler ¶
func NewSamlHandler(config *SamlServiceProviderConfig, provider *SamlServiceProvider) *SamlHandler
func (*SamlHandler) GetSessionId ¶
func (handler *SamlHandler) GetSessionId(r *http.Request) string
func (*SamlHandler) Handle ¶
func (handler *SamlHandler) Handle(w http.ResponseWriter, r *http.Request) (int, error)
type SamlServiceProvider ¶
type SamlServiceProvider struct { SessiondataHeaderName string SamlServiceProvider *saml2.SAMLServiceProvider SamlHandler *SamlHandler Logger *zap.SugaredLogger Config *SamlServiceProviderConfig // contains filtered or unexported fields }
func NewSamlServiceProviderFromConfig ¶
func NewSamlServiceProviderFromConfig(config *SamlServiceProviderConfig, sessionCache securityprotocol.SessionCache) (*SamlServiceProvider, error)
func (*SamlServiceProvider) CreateLogoutResponse ¶
func (a *SamlServiceProvider) CreateLogoutResponse(logoutRequest *saml2.LogoutRequest, w http.ResponseWriter) (int, error)
func (SamlServiceProvider) GenerateAuthenticationRequest ¶
func (a SamlServiceProvider) GenerateAuthenticationRequest(w http.ResponseWriter, r *http.Request) (int, error)
func (SamlServiceProvider) HandleService ¶
func (a SamlServiceProvider) HandleService(w http.ResponseWriter, r *http.Request, service securityprotocol.HttpHandler) (int, error)
func (*SamlServiceProvider) Metadata ¶
func (provider *SamlServiceProvider) Metadata() (*types.EntityDescriptor, error)
func (*SamlServiceProvider) ParseLogoutPayload ¶
func (a *SamlServiceProvider) ParseLogoutPayload(r *http.Request) (*saml2.LogoutRequest, *types.LogoutResponse, error)
type SamlServiceProviderConfig ¶
type SamlServiceProviderConfig struct { ServiceProviderKeystore *tls.Certificate EntityId string CookieDomain string CookiePath string AudienceRestriction string SignAuthnRequest bool IdpMetaDataUrl string SessionHeaderName string SessionExpiryHours string SessiondataHeaderName string SkipSignatureValidation bool ExternalUrl string SamlMetadataPath string SamlLogoutPath string SamlSLOPath string SamlSSOPath string LogoutLandingPage string RoleAttributeName string AllowedRoles []string Logger *zap.SugaredLogger }
func (*SamlServiceProviderConfig) AssertionConsumerServiceUrl ¶
func (config *SamlServiceProviderConfig) AssertionConsumerServiceUrl() string
func (*SamlServiceProviderConfig) SloConsumerServiceUrl ¶
func (config *SamlServiceProviderConfig) SloConsumerServiceUrl() string
type WrappingSessionCache ¶ added in v1.0.9
type WrappingSessionCache struct {
// contains filtered or unexported fields
}
func (WrappingSessionCache) DeleteSessionData ¶ added in v1.0.9
func (w WrappingSessionCache) DeleteSessionData(sessionId string) error
func (WrappingSessionCache) FindSessionDataForSessionId ¶ added in v1.0.9
func (w WrappingSessionCache) FindSessionDataForSessionId(sessionId string) (*securityprotocol.SessionData, error)
func (WrappingSessionCache) SaveSessionData ¶ added in v1.0.9
func (w WrappingSessionCache) SaveSessionData(data *securityprotocol.SessionData) error
Click to show internal directories.
Click to hide internal directories.