oidclogout

package
v9.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Logout of OpenID Connect.

Invalidate an access token and a refresh token that were generated as a response to the `/_security/oidc/authenticate` API.

If the OpenID Connect authentication realm in Elasticsearch is accordingly configured, the response to this call will contain a URI pointing to the end session endpoint of the OpenID Connect Provider in order to perform single logout.

Elasticsearch exposes all the necessary OpenID Connect related functionality with the OpenID Connect APIs. These APIs are used internally by Kibana in order to provide OpenID Connect based authentication, but can also be used by other, custom web applications or other clients.

Index

Constants

This section is empty.

Variables

View Source
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 NewOidcLogout

type NewOidcLogout func() *OidcLogout

NewOidcLogout type alias for index.

func NewOidcLogoutFunc

func NewOidcLogoutFunc(tp elastictransport.Interface) NewOidcLogout

NewOidcLogoutFunc returns a new instance of OidcLogout with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.

type OidcLogout

type OidcLogout struct {
	// contains filtered or unexported fields
}

func New

Logout of OpenID Connect.

Invalidate an access token and a refresh token that were generated as a response to the `/_security/oidc/authenticate` API.

If the OpenID Connect authentication realm in Elasticsearch is accordingly configured, the response to this call will contain a URI pointing to the end session endpoint of the OpenID Connect Provider in order to perform single logout.

Elasticsearch exposes all the necessary OpenID Connect related functionality with the OpenID Connect APIs. These APIs are used internally by Kibana in order to provide OpenID Connect based authentication, but can also be used by other, custom web applications or other clients.

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-oidc-logout

func (OidcLogout) Do

func (r OidcLogout) Do(providedCtx context.Context) (*Response, error)

Do runs the request through the transport, handle the response and returns a oidclogout.Response

func (*OidcLogout) ErrorTrace

func (r *OidcLogout) ErrorTrace(errortrace bool) *OidcLogout

ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace

func (*OidcLogout) FilterPath

func (r *OidcLogout) FilterPath(filterpaths ...string) *OidcLogout

FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path

func (*OidcLogout) Header

func (r *OidcLogout) Header(key, value string) *OidcLogout

Header set a key, value pair in the OidcLogout headers map.

func (*OidcLogout) HttpRequest

func (r *OidcLogout) HttpRequest(ctx context.Context) (*http.Request, error)

HttpRequest returns the http.Request object built from the given parameters.

func (*OidcLogout) Human

func (r *OidcLogout) Human(human bool) *OidcLogout

Human When set to `true` will return statistics in a format suitable for humans. For example `"exists_time": "1h"` for humans and `"exists_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 (OidcLogout) Perform

func (r OidcLogout) Perform(providedCtx context.Context) (*http.Response, error)

Perform runs the http.Request through the provided transport and returns an http.Response.

func (*OidcLogout) Pretty

func (r *OidcLogout) Pretty(pretty bool) *OidcLogout

Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty

func (*OidcLogout) Raw

func (r *OidcLogout) Raw(raw io.Reader) *OidcLogout

Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.

func (*OidcLogout) RefreshToken

func (r *OidcLogout) RefreshToken(refreshtoken string) *OidcLogout

The refresh token to be invalidated. API name: refresh_token

func (*OidcLogout) Request

func (r *OidcLogout) Request(req *Request) *OidcLogout

Request allows to set the request property with the appropriate payload.

func (*OidcLogout) Token

func (r *OidcLogout) Token(token string) *OidcLogout

The access token to be invalidated. API name: token

type Request

type Request struct {

	// RefreshToken The refresh token to be invalidated.
	RefreshToken *string `json:"refresh_token,omitempty"`
	// Token The access token to be invalidated.
	Token string `json:"token"`
}

Request holds the request body struct for the package oidclogout

https://github.com/elastic/elasticsearch-specification/blob/907d11a72a6bfd37b777d526880c56202889609e/specification/security/oidc_logout/Request.ts#L22-L52

func NewRequest

func NewRequest() *Request

NewRequest returns a Request

func (*Request) FromJSON

func (r *Request) FromJSON(data string) (*Request, error)

FromJSON allows to load an arbitrary json into the request structure

type Response

type Response struct {

	// Redirect A URI that points to the end session endpoint of the OpenID Connect Provider
	// with all the parameters of the logout request as HTTP GET parameters.
	Redirect string `json:"redirect"`
}

Response holds the response body struct for the package oidclogout

https://github.com/elastic/elasticsearch-specification/blob/907d11a72a6bfd37b777d526880c56202889609e/specification/security/oidc_logout/Response.ts#L20-L27

func NewResponse

func NewResponse() *Response

NewResponse returns a Response

Jump to

Keyboard shortcuts

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