Documentation
¶
Overview ¶
Prepare SAML authentication.
Create a SAML authentication request (`<AuthnRequest>`) as a URL string based on the configuration of the respective SAML realm in Elasticsearch.
NOTE: This API is intended for use by custom web applications other than Kibana. If you are using Kibana, refer to the documentation for configuring SAML single-sign-on on the Elastic Stack.
This API returns a URL pointing to the SAML Identity Provider. You can use the URL to redirect the browser of the user in order to continue the authentication process. The URL includes a single parameter named `SAMLRequest`, which contains a SAML Authentication request that is deflated and Base64 encoded. If the configuration dictates that SAML authentication requests should be signed, the URL has two extra parameters named `SigAlg` and `Signature`. These parameters contain the algorithm used for the signature and the signature value itself. It also returns a random string that uniquely identifies this SAML Authentication request. The caller of this API needs to store this identifier as it needs to be used in a following step of the authentication process.
Index ¶
- Variables
- type NewSamlPrepareAuthentication
- type Request
- type Response
- type SamlPrepareAuthentication
- func (r *SamlPrepareAuthentication) Acs(acs string) *SamlPrepareAuthentication
- func (r SamlPrepareAuthentication) Do(providedCtx context.Context) (*Response, error)
- func (r *SamlPrepareAuthentication) ErrorTrace(errortrace bool) *SamlPrepareAuthentication
- func (r *SamlPrepareAuthentication) FilterPath(filterpaths ...string) *SamlPrepareAuthentication
- func (r *SamlPrepareAuthentication) Header(key, value string) *SamlPrepareAuthentication
- func (r *SamlPrepareAuthentication) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *SamlPrepareAuthentication) Human(human bool) *SamlPrepareAuthentication
- func (r SamlPrepareAuthentication) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *SamlPrepareAuthentication) Pretty(pretty bool) *SamlPrepareAuthentication
- func (r *SamlPrepareAuthentication) Raw(raw io.Reader) *SamlPrepareAuthentication
- func (r *SamlPrepareAuthentication) Realm(realm string) *SamlPrepareAuthentication
- func (r *SamlPrepareAuthentication) RelayState(relaystate string) *SamlPrepareAuthentication
- func (r *SamlPrepareAuthentication) Request(req *Request) *SamlPrepareAuthentication
Constants ¶
This section is empty.
Variables ¶
var ErrBuildPath = errors.New("cannot build path, check for missing path parameters")
ErrBuildPath is returned in case of missing parameters within the build of the request.
Functions ¶
This section is empty.
Types ¶
type NewSamlPrepareAuthentication ¶
type NewSamlPrepareAuthentication func() *SamlPrepareAuthentication
NewSamlPrepareAuthentication type alias for index.
func NewSamlPrepareAuthenticationFunc ¶
func NewSamlPrepareAuthenticationFunc(tp elastictransport.Interface) NewSamlPrepareAuthentication
NewSamlPrepareAuthenticationFunc returns a new instance of SamlPrepareAuthentication with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type Request ¶
type Request struct { // Acs The Assertion Consumer Service URL that matches the one of the SAML realms in // Elasticsearch. // The realm is used to generate the authentication request. You must specify // either this parameter or the `realm` parameter. Acs *string `json:"acs,omitempty"` // Realm The name of the SAML realm in Elasticsearch for which the configuration is // used to generate the authentication request. // You must specify either this parameter or the `acs` parameter. Realm *string `json:"realm,omitempty"` // RelayState A string that will be included in the redirect URL that this API returns as // the `RelayState` query parameter. // If the Authentication Request is signed, this value is used as part of the // signature computation. RelayState *string `json:"relay_state,omitempty"` }
Request holds the request body struct for the package samlprepareauthentication
type Response ¶ added in v8.7.0
type Response struct { // Id A unique identifier for the SAML Request to be stored by the caller of the // API. Id string `json:"id"` // Realm The name of the Elasticsearch realm that was used to construct the // authentication request. Realm string `json:"realm"` // Redirect The URL to redirect the user to. Redirect string `json:"redirect"` }
Response holds the response body struct for the package samlprepareauthentication
type SamlPrepareAuthentication ¶
type SamlPrepareAuthentication struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *SamlPrepareAuthentication
Prepare SAML authentication.
Create a SAML authentication request (`<AuthnRequest>`) as a URL string based on the configuration of the respective SAML realm in Elasticsearch.
NOTE: This API is intended for use by custom web applications other than Kibana. If you are using Kibana, refer to the documentation for configuring SAML single-sign-on on the Elastic Stack.
This API returns a URL pointing to the SAML Identity Provider. You can use the URL to redirect the browser of the user in order to continue the authentication process. The URL includes a single parameter named `SAMLRequest`, which contains a SAML Authentication request that is deflated and Base64 encoded. If the configuration dictates that SAML authentication requests should be signed, the URL has two extra parameters named `SigAlg` and `Signature`. These parameters contain the algorithm used for the signature and the signature value itself. It also returns a random string that uniquely identifies this SAML Authentication request. The caller of this API needs to store this identifier as it needs to be used in a following step of the authentication process.
func (*SamlPrepareAuthentication) Acs ¶ added in v8.9.0
func (r *SamlPrepareAuthentication) Acs(acs string) *SamlPrepareAuthentication
Acs The Assertion Consumer Service URL that matches the one of the SAML realms in Elasticsearch. The realm is used to generate the authentication request. You must specify either this parameter or the `realm` parameter. API name: acs
func (SamlPrepareAuthentication) Do ¶
func (r SamlPrepareAuthentication) Do(providedCtx context.Context) (*Response, error)
Do runs the request through the transport, handle the response and returns a samlprepareauthentication.Response
func (*SamlPrepareAuthentication) ErrorTrace ¶ added in v8.14.0
func (r *SamlPrepareAuthentication) ErrorTrace(errortrace bool) *SamlPrepareAuthentication
ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace
func (*SamlPrepareAuthentication) FilterPath ¶ added in v8.14.0
func (r *SamlPrepareAuthentication) FilterPath(filterpaths ...string) *SamlPrepareAuthentication
FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path
func (*SamlPrepareAuthentication) Header ¶
func (r *SamlPrepareAuthentication) Header(key, value string) *SamlPrepareAuthentication
Header set a key, value pair in the SamlPrepareAuthentication headers map.
func (*SamlPrepareAuthentication) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*SamlPrepareAuthentication) Human ¶ added in v8.14.0
func (r *SamlPrepareAuthentication) Human(human bool) *SamlPrepareAuthentication
Human When set to `true` will return statistics in a format suitable for humans. For example `"exists_time": "1h"` for humans and `"eixsts_time_in_millis": 3600000` for computers. When disabled the human readable values will be omitted. This makes sense for responses being consumed only by machines. API name: human
func (SamlPrepareAuthentication) Perform ¶ added in v8.7.0
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*SamlPrepareAuthentication) Pretty ¶ added in v8.14.0
func (r *SamlPrepareAuthentication) Pretty(pretty bool) *SamlPrepareAuthentication
Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty
func (*SamlPrepareAuthentication) Raw ¶
func (r *SamlPrepareAuthentication) Raw(raw io.Reader) *SamlPrepareAuthentication
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
func (*SamlPrepareAuthentication) Realm ¶ added in v8.9.0
func (r *SamlPrepareAuthentication) Realm(realm string) *SamlPrepareAuthentication
Realm The name of the SAML realm in Elasticsearch for which the configuration is used to generate the authentication request. You must specify either this parameter or the `acs` parameter. API name: realm
func (*SamlPrepareAuthentication) RelayState ¶ added in v8.9.0
func (r *SamlPrepareAuthentication) RelayState(relaystate string) *SamlPrepareAuthentication
RelayState A string that will be included in the redirect URL that this API returns as the `RelayState` query parameter. If the Authentication Request is signed, this value is used as part of the signature computation. API name: relay_state
func (*SamlPrepareAuthentication) Request ¶
func (r *SamlPrepareAuthentication) Request(req *Request) *SamlPrepareAuthentication
Request allows to set the request property with the appropriate payload.