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 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
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 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 // 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
Click to show internal directories.
Click to hide internal directories.