Skip to main content

AuthN | Go SDK | Session Endpoints

Session Endpoints

Invalidate Session | Client

func (a *ClientSession) Invalidate(ctx context.Context, input ClientSessionInvalidateRequest) (*pangea.PangeaResponse[ClientSessionInvalidateResult], error)

Invalidate a session by session ID using a client token.

required parameters

context.Context
input := authn.ClientSessionInvalidateRequest{
	Token: "ptu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
	SessionID: "pmt_zppkzrjguxyblaia6itbiesejn7jejnr",
}

resp, err := authncli.Client.Session.Invalidate(ctx, input)

List sessions (client token)

func (a *ClientSession) List(ctx context.Context, input ClientSessionListRequest) (*pangea.PangeaResponse[SessionListResult], error)

List sessions using a client token.

required parameters

context.Context
input := authn.ClientSessionListRequest{
	Token: "ptu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
}

resp, err := authncli.Client.Session.List(ctx, input)

Log out (client token)

func (a *ClientSession) Logout(ctx context.Context, input ClientSessionLogoutRequest) (*pangea.PangeaResponse[ClientSessionLogoutResult], error)

Log out the current user's session.

required parameters

context.Context
input := authn.ClientSessionLogoutRequest{
	Token: "ptu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
}

resp, err := authncli.Client.Session.Logout(ctx, input)

Refresh a Session

func (a *ClientSession) Refresh(ctx context.Context, input ClientSessionRefreshRequest) (*pangea.PangeaResponse[ClientSessionRefreshResult], error)

Refresh a session token.

required parameters

context.Context
input := authn.ClientSessionRefreshRequest{
	RefreshToken: "ptr_xpkhwpnz2cmegsws737xbsqnmnuwtbm5",
	UserToken: "ptu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
}

resp, err := authncli.Client.Session.Refresh(ctx, input)

Invalidate Session

func (a *Session) Invalidate(ctx context.Context, input SessionInvalidateRequest) (*pangea.PangeaResponse[SessionInvalidateResult], error)

Invalidate a session by session ID.

required parameters

context.Context
input := authn.SessionInvalidateRequest{
	SessionID: "pmt_zppkzrjguxyblaia6itbiesejn7jejnr",
}

resp, err := authncli.Session.Invalidate(ctx, input)

List session (service token)

func (a *Session) List(ctx context.Context, input SessionListRequest) (*pangea.PangeaResponse[SessionListResult], error)

List sessions.

required parameters

context.Context
input := authn.SessionListRequest{}
resp, err := authn.Session.List(ctx, input)

Log out (service token)

func (a *Session) Logout(ctx context.Context, input SessionLogoutRequest) (*pangea.PangeaResponse[SessionLogoutResult], error)

Invalidate all sessions belonging to a user.

required parameters

context.Context
input := authn.SessionLogoutRequest{
	UserID: "pui_xpkhwpnz2cmegsws737xbsqnmnuwtvm5",
}

resp, err := authncli.Session.Logout(ctx, input)

Type ClientSessionInvalidateRequest

type ClientSessionInvalidateRequest struct

required parameters

pangea.BaseRequest

Base request has ConfigID for multi-config projects

string `json:"token"`
string `json:"session_id"`
type ClientSessionInvalidateRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	Token		string	`json:"token"`
	SessionID	string	`json:"session_id"`
}

Type ClientSessionListRequest

type ClientSessionListRequest struct

required parameters

pangea.BaseRequest

Base request has ConfigID for multi-config projects

string `json:"token"`
pangea.Filter `json:"filter,omitempty"`

Should use FilterSessionList object here

string `json:"last,omitempty"`
type ClientSessionListRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	Token	string	`json:"token"`

	// Should use FilterSessionList object here
	Filter	pangea.Filter		`json:"filter,omitempty"`
	Last	string			`json:"last,omitempty"`
	Order	ItemOrder		`json:"order,omitempty"`
	OrderBy	SessionListOrderBy	`json:"order_by,omitempty"`
}

Type ClientSessionLogoutRequest

type ClientSessionLogoutRequest struct

required parameters

pangea.BaseRequest

Base request has ConfigID for multi-config projects

string `json:"token"`
type ClientSessionLogoutRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	Token	string	`json:"token"`
}

Type ClientSessionRefreshRequest

type ClientSessionRefreshRequest struct

required parameters

pangea.BaseRequest

Base request has ConfigID for multi-config projects

string `json:"refresh_token"`
string `json:"user_token,omitempty"`
type ClientSessionRefreshRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	RefreshToken	string	`json:"refresh_token"`
	UserToken	string	`json:"user_token,omitempty"`
}

Type ItemOrder

type ItemOrder string
type ItemOrder string

Type SessionInvalidateRequest

type SessionInvalidateRequest struct

required parameters

pangea.BaseRequest

Base request has ConfigID for multi-config projects

string `json:"session_id"`
type SessionInvalidateRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	SessionID	string	`json:"session_id"`
}

Type SessionListOrderBy

type SessionListOrderBy string
type SessionListOrderBy string

Type SessionListRequest

type SessionListRequest struct

required parameters

pangea.BaseRequest

Base request has ConfigID for multi-config projects

pangea.Filter `json:"filter,omitempty"`

Should use FilterSessionList object here

string `json:"last,omitempty"`
type SessionListRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	// Should use FilterSessionList object here
	Filter	pangea.Filter		`json:"filter,omitempty"`
	Last	string			`json:"last,omitempty"`
	Order	ItemOrder		`json:"order,omitempty"`
	OrderBy	SessionListOrderBy	`json:"order_by,omitempty"`
}

Type SessionLogoutRequest

type SessionLogoutRequest struct

required parameters

pangea.BaseRequest

Base request has ConfigID for multi-config projects

string `json:"user_id"`
type SessionLogoutRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	UserID	string	`json:"user_id"`
}