Skip to main content

AuthN | Go SDK | User Endpoints

User Endpoints

Get User (client token)

func (a *Client) Userinfo(ctx context.Context, input ClientUserinfoRequest) (*pangea.PangeaResponse[ClientUserinfoResult], error)

Retrieve the logged in user's token and information.

required parameters

context.Context
input := authn.ClientUserinfoRequest{
	Code: "pmc_d6chl6qulpn3it34oerwm3cqwsjd6dxw",
}

esp, err := authncli.Client.Userinfo(ctx, input)

Change a user's password

func (a *ClientPassword) Change(ctx context.Context, input ClientPasswordChangeRequest) (*pangea.PangeaResponse[ClientPasswordChangeResult], error)

Change a user's password given the current password.

required parameters

context.Context
input := authn.ClientPasswordChangeRequest{
	Token: "ptu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
	OldPassword: "hunter2",
	NewPassword: "My2n+Password",
}

resp, err := authncli.Client.Password.Change(ctx, input)

Create User

func (a *User) Create(ctx context.Context, input UserCreateRequest) (*pangea.PangeaResponse[UserCreateResult], error)

Create a user. Also allows creating the user's credentials.

required parameters

context.Context
profile := &authn.ProfileData{
	"first_name": "Joe",
	"last_name": "User",
}

input := authn.UserCreateRequest{
	Email: "joe.user@email.com",
	Profile: profile,
}

resp, err := authncli.User.Create(ctx, input)

Delete User

func (a *User) Delete(ctx context.Context, input UserDeleteRequest) (*pangea.PangeaResponse[UserDeleteResult], error)

Delete a user.

required parameters

context.Context
input := UserDeleteRequest{
	Email: "joe.user@email.com",
}

authncli.User.Delete(ctx, input)

List Users

func (a *User) List(ctx context.Context, input UserListRequest) (*pangea.PangeaResponse[UserListResult], error)

Look up users by scopes.

required parameters

context.Context
input := authn.UserListRequest{}
resp, err := authncli.User.List(ctx, input)

Update user's settings

func (a *User) Update(ctx context.Context, input UserUpdateRequest) (*pangea.PangeaResponse[UserUpdateResult], error)

Update user's settings.

required parameters

context.Context
input := authn.UserUpdateRequest{
	Email: pangea.String("joe.user@email.com"),
	RequireMFA: pangea.Bool(true),
}

resp, err := authncli.User.Update(ctx, input)

Delete user authenticator

func (a *UserAuthenticators) Delete(ctx context.Context, input UserAuthenticatorsDeleteRequest) (*pangea.PangeaResponse[UserAuthenticatorsDeleteResult], error)

Delete a user's authenticator.

required parameters

context.Context
input := authn.UserAuthenticatorsDeleteRequest{
	ID: pangea.String("pui_zgp532cx6opljeavvllmbi3iwmq72f7f"),
	AuthenticatorID: "pau_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
}

resp, err := authncli.User.Authenticators.Delete(ctx, input)

Get user authenticators

func (a *UserAuthenticators) List(ctx context.Context, input UserAuthenticatorsListRequest) (*pangea.PangeaResponse[UserAuthenticatorsListResult], error)

Get user's authenticators by identity or email.

required parameters

context.Context
input := authn.UserAuthenticatorsListRequest{
	ID: pangea.String("pui_xpkhwpnz2cmegsws737xbsqnmnuwtvm5"),
}

resp, err := authncli.User.Authenticators.List(ctx, input)

Get user

func (a *UserProfile) Get(ctx context.Context, input UserProfileGetRequest) (*pangea.PangeaResponse[UserProfileGetResult], error)

Get user's information by identity or email.

required parameters

context.Context
input := authn.UserProfileGetRequest{
	Email: pangea.String("joe.user@email.com"),
}

resp, err := authncli.User.Profile.Get(ctx, input)

Update user

func (a *UserProfile) Update(ctx context.Context, input UserProfileUpdateRequest) (*pangea.PangeaResponse[UserProfileUpdateResult], error)

Update user's information by identity or email.

required parameters

context.Context
input := authn.UserProfileUpdateRequest{
	Email: pangea.String("joe.user@email.com"),
	Profile: authn.ProfileData{
		"country": "Argentina",
	},
}

resp, err := authncli.User.Profile.Update(ctx, input)

Type ClientPasswordChangeRequest

type ClientPasswordChangeRequest struct

required parameters

pangea.BaseRequest

Base request has ConfigID for multi-config projects

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

	Token		string	`json:"token"`
	OldPassword	string	`json:"old_password"`
	NewPassword	string	`json:"new_password"`
}

Type ClientUserinfoRequest

type ClientUserinfoRequest struct

required parameters

pangea.BaseRequest

Base request has ConfigID for multi-config projects

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

	Code	string	`json:"code"`
}

Type UserAuthenticatorsDeleteRequest

type UserAuthenticatorsDeleteRequest struct

required parameters

pangea.BaseRequest

Base request has ConfigID for multi-config projects

*string `json:"id,omitempty"`
*string `json:"email,omitempty"`
*string `json:"username,omitempty"`
string `json:"authenticator_id"`
type UserAuthenticatorsDeleteRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	ID		*string	`json:"id,omitempty"`		// The identity of a user or a service.
	Email		*string	`json:"email,omitempty"`	// An email address.
	Username	*string	`json:"username,omitempty"`	// A username.
	AuthenticatorID	string	`json:"authenticator_id"`	// An ID for an authenticator.
}

Type UserAuthenticatorsListRequest

type UserAuthenticatorsListRequest struct

required parameters

*string `json:"id,omitempty"`
*string `json:"email,omitempty"`
*string `json:"username,omitempty"`
type UserAuthenticatorsListRequest struct {
	pangea.BaseRequest

	ID		*string	`json:"id,omitempty"`		// The identity of a user or a service.
	Email		*string	`json:"email,omitempty"`	// An email address.
	Username	*string	`json:"username,omitempty"`	// A username.
}

Type UserCreateRequest

type UserCreateRequest struct

required parameters

pangea.BaseRequest

Base request has ConfigID for multi-config projects

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

	Email		string		`json:"email"`			// An email address.
	Profile		ProfileData	`json:"profile"`		// A user profile as a collection of string properties.
	Username	string		`json:"username,omitempty"`	// A username.
}

Type UserDeleteRequest

type UserDeleteRequest struct

required parameters

pangea.BaseRequest

Base request has ConfigID for multi-config projects

string `json:"email,omitempty"`
string `json:"id,omitempty"`
string `json:"username,omitempty"`
type UserDeleteRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	Email		string	`json:"email,omitempty"`	// An email address.
	ID		string	`json:"id,omitempty"`		// The identity of a user or a service.
	Username	string	`json:"username,omitempty"`	// A username.
}

Type UserListRequest

type UserListRequest struct

required parameters

pangea.BaseRequest

Base request has ConfigID for multi-config projects

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

Should user FilterUserList object here

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

	// Should user FilterUserList object here
	Filter	pangea.Filter	`json:"filter,omitempty"`
	Last	string		`json:"last,omitempty"`
	Order	ItemOrder	`json:"order,omitempty"`
	OrderBy	UserListOrderBy	`json:"order_by,omitempty"`
	Size	int		`json:"size,omitempty"`
}

Type UserProfileGetRequest

type UserProfileGetRequest struct

required parameters

pangea.BaseRequest

Base request has ConfigID for multi-config projects

*string `json:"id,omitempty"`
*string `json:"email,omitempty"`
*string `json:"username,omitempty"`
type UserProfileGetRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	ID		*string	`json:"id,omitempty"`		// The identity of a user or a service.
	Email		*string	`json:"email,omitempty"`	// An email address.
	Username	*string	`json:"username,omitempty"`	// A username.
}

Type UserProfileUpdateRequest

type UserProfileUpdateRequest struct

required parameters

pangea.BaseRequest

Base request has ConfigID for multi-config projects

*string `json:"id,omitempty"`
*string `json:"email,omitempty"`
*string `json:"username,omitempty"`
type UserProfileUpdateRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	Profile		ProfileData	`json:"profile"`		// Updates to a user profile.
	ID		*string		`json:"id,omitempty"`		// The identity of a user or a service.
	Email		*string		`json:"email,omitempty"`	// An email address.
	Username	*string		`json:"username,omitempty"`	// A username.
}

Type UserUpdateRequest

type UserUpdateRequest struct

required parameters

pangea.BaseRequest

Base request has ConfigID for multi-config projects

*string `json:"id,omitempty"`
*string `json:"email,omitempty"`
*string `json:"username,omitempty"`
*bool `json:"disabled,omitempty"`
*bool `json:"unlock,omitempty"`
type UserUpdateRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	ID		*string	`json:"id,omitempty"`		// The identity of a user or a service.
	Email		*string	`json:"email,omitempty"`	// An email address.
	Username	*string	`json:"username,omitempty"`	// A username.
	Disabled	*bool	`json:"disabled,omitempty"`	// New disabled value. Disabling a user account will prevent them from logging in.
	Unlock		*bool	`json:"unlock,omitempty"`	// Unlock a user account if it has been locked out due to failed authentication attempts.
}