Documentation ¶
Index ¶
- Constants
- func AddExtraClaimsToSessionData(sessionId string, sessionData *securityprotocol.SessionData, r *http.Request) (*securityprotocol.SessionData, error)
- func CreateCaCertPool(trustCertFiles []string) *x509.CertPool
- func GetExpiryDate(expiresInSeconds int64) time.Time
- func ResponseWithSuccessfulAuth(w http.ResponseWriter, sessionData *securityprotocol.SessionData, ...) (int, error)
- type AuthenticatedAssertion
- type Claim
- type OioIdwsRestAuthResponse
- type OioIdwsRestAuthenticationInfo
- type OioIdwsRestClientAuthentification
- type OioIdwsRestDecorateRequestWithAuthenticationToken
- type OioIdwsRestHttpProtocolClient
- func (client OioIdwsRestHttpProtocolClient) GetEncodedTokenFromSts(sessionId string, decodedToken []byte, claims map[string]string) (string, error)
- func (client OioIdwsRestHttpProtocolClient) Handle(w http.ResponseWriter, r *http.Request) (int, error)
- func (client OioIdwsRestHttpProtocolClient) HandleService(w http.ResponseWriter, r *http.Request, service securityprotocol.HttpHandler) (int, error)
- func (client OioIdwsRestHttpProtocolClient) HandleServiceWithCallback(w http.ResponseWriter, r *http.Request, service securityprotocol.HttpHandler) (int, error, *func())
- type OioIdwsRestHttpProtocolClientConfig
- type OioIdwsRestHttpProtocolServerConfig
- type OioIdwsRestWsp
- type TokenAuthenticator
Constants ¶
View Source
const HEADER_AUTHORIZATION = "Authorization"
View Source
const HEADER_WWW_AUTHENTICATE = "WWW-Authenticate"
View Source
const HTTP_HEADER_X_CLAIMS = "X-Claims"
View Source
const OIO_IDWS_REST_TOKEN_TYPE_BEARER = "Bearer"
View Source
const OIO_IDWS_REST_TOKEN_TYPE_HOLDER_OF_KEY = "Holder-of-key"
Variables ¶
This section is empty.
Functions ¶
func AddExtraClaimsToSessionData ¶
func AddExtraClaimsToSessionData(sessionId string, sessionData *securityprotocol.SessionData, r *http.Request) (*securityprotocol.SessionData, error)
func CreateCaCertPool ¶
func GetExpiryDate ¶ added in v1.1.15
func ResponseWithSuccessfulAuth ¶
func ResponseWithSuccessfulAuth(w http.ResponseWriter, sessionData *securityprotocol.SessionData, logger *zap.SugaredLogger) (int, error)
Types ¶
type AuthenticatedAssertion ¶
type AuthenticatedAssertion struct {
// contains filtered or unexported fields
}
func (AuthenticatedAssertion) GetAssertion ¶
func (a AuthenticatedAssertion) GetAssertion() *types.Assertion
type OioIdwsRestAuthResponse ¶
type OioIdwsRestAuthResponse struct { AccessToken string `json:"access_token"` TokenType string `json:"token_type"` ExpiresIn int64 `json:"expires_in"` }
func CreateOioIdwsRestAuthResponseFromHttpReponse ¶
func CreateOioIdwsRestAuthResponseFromHttpReponse(authResponse *http.Response, logger *zap.SugaredLogger) (*OioIdwsRestAuthResponse, error)
type OioIdwsRestAuthenticationInfo ¶
func CreateAuthenticatonRequestInfoFromReponse ¶
func CreateAuthenticatonRequestInfoFromReponse(authResponse *http.Response, logger *zap.SugaredLogger) (*OioIdwsRestAuthenticationInfo, error)
type OioIdwsRestClientAuthentification ¶
type OioIdwsRestClientAuthentification func(http.ResponseWriter, *http.Request, *securityprotocol.SessionData) (*OioIdwsRestAuthenticationInfo, int, error)
type OioIdwsRestDecorateRequestWithAuthenticationToken ¶
type OioIdwsRestDecorateRequestWithAuthenticationToken func(tokenData *securityprotocol.TokenData, r *http.Request) error
type OioIdwsRestHttpProtocolClient ¶
type OioIdwsRestHttpProtocolClient struct { Logger *zap.SugaredLogger // contains filtered or unexported fields }
func NewOioIdwsRestHttpProtocolClient ¶
func NewOioIdwsRestHttpProtocolClient(config OioIdwsRestHttpProtocolClientConfig, tokenCache securityprotocol.TokenCache, logger *zap.SugaredLogger) *OioIdwsRestHttpProtocolClient
func (OioIdwsRestHttpProtocolClient) GetEncodedTokenFromSts ¶
func (OioIdwsRestHttpProtocolClient) Handle ¶
func (client OioIdwsRestHttpProtocolClient) Handle(w http.ResponseWriter, r *http.Request) (int, error)
func (OioIdwsRestHttpProtocolClient) HandleService ¶
func (client OioIdwsRestHttpProtocolClient) HandleService(w http.ResponseWriter, r *http.Request, service securityprotocol.HttpHandler) (int, error)
func (OioIdwsRestHttpProtocolClient) HandleServiceWithCallback ¶ added in v1.1.15
func (client OioIdwsRestHttpProtocolClient) HandleServiceWithCallback(w http.ResponseWriter, r *http.Request, service securityprotocol.HttpHandler) (int, error, *func())
type OioIdwsRestHttpProtocolClientConfig ¶
type OioIdwsRestHttpProtocolClientConfig struct { SessionHeaderName string UseKombitVersion bool StsUrl string TrustCertFiles []string ClientCertFile string ClientKeyFile string ServiceAudience string ServiceEndpoint string ServiceTokenEndpoint string SessionDataFetcher securityprotocol.SessionDataFetcher Service securityprotocol.HttpHandler // contains filtered or unexported fields }
type OioIdwsRestHttpProtocolServerConfig ¶
type OioIdwsRestHttpProtocolServerConfig struct { TrustCertFiles []string AudienceRestriction string Service securityprotocol.HttpHandler HoK bool SessiondataHeaderName string ClientCertHandler func(req *http.Request) *x509.Certificate }
type OioIdwsRestWsp ¶
type OioIdwsRestWsp struct { Service securityprotocol.HttpHandler HoK bool SessiondataHeaderName string ClientCertHandler func(req *http.Request) *x509.Certificate Logger *zap.SugaredLogger // contains filtered or unexported fields }
func NewOioIdwsRestWsp ¶
func NewOioIdwsRestWsp(sessionCache securityprotocol.SessionCache, tokenAuthenticator *TokenAuthenticator, matchHandler *securityprotocol.MatchHandler, service securityprotocol.HttpHandler, clientCertHandler func(req *http.Request) *x509.Certificate, logger *zap.SugaredLogger) *OioIdwsRestWsp
func NewOioIdwsRestWspFromConfig ¶
func NewOioIdwsRestWspFromConfig(config *OioIdwsRestHttpProtocolServerConfig, sessionCache securityprotocol.SessionCache, logger *zap.SugaredLogger) *OioIdwsRestWsp
func (OioIdwsRestWsp) Handle ¶
func (a OioIdwsRestWsp) Handle(w http.ResponseWriter, r *http.Request) (int, error)
func (OioIdwsRestWsp) HandleService ¶
func (a OioIdwsRestWsp) HandleService(w http.ResponseWriter, r *http.Request, service securityprotocol.HttpHandler) (int, error)
type TokenAuthenticator ¶
type TokenAuthenticator struct {
// contains filtered or unexported fields
}
func NewTokenAuthenticator ¶
func NewTokenAuthenticator(audienceRestriction string, certPaths []string, validateSamlConstraints bool, logger *zap.SugaredLogger) *TokenAuthenticator
func (TokenAuthenticator) Authenticate ¶
func (t TokenAuthenticator) Authenticate(clientCert *x509.Certificate, r *http.Request) (string, *AuthenticatedAssertion, error)
func (TokenAuthenticator) ParseAndValidateAuthenticationRequestPayload ¶
func (t TokenAuthenticator) ParseAndValidateAuthenticationRequestPayload(body string, clientCert *x509.Certificate) (string, *AuthenticatedAssertion, error)
Click to show internal directories.
Click to hide internal directories.