authing_v3

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeExtIdpConnAssociationState_authing_fix

func ChangeExtIdpConnAssociationState_authing_fix(client *management.ManagementClient, host string, userPoolId string, reqDto *dto.ChangeExtIdpAssociationStateDto) *dto.IsSuccessRespDto

* @summary 租户关联身份源 * @description 租户可以关联或取消关联身份源连接。 * @param requestBody * @returns IsSuccessRespDto * * * reqDto *ChangeExtIdpAssociationStateDto

func ChangeExtIdpConnState_authing_fix

func ChangeExtIdpConnState_authing_fix(client *management.ManagementClient, host string, userPoolId string, reqDto *dto.ChangeExtIdpConnStateDto) *dto.IsSuccessRespDto

* authing api disable case has issue, so add fix function here???? * * @summary 身份源连接开关 * @description 身份源连接开关,可以打开或关闭身份源连接。 * @param requestBody * @returns IsSuccessRespDto

func NewAuthingAuthCli

func NewAuthingAuthCli(appId, appSecret, appHost, appRedirectUri, appLogoutRedirectUri, accessToken string) *authentication.AuthenticationClient

func NewAuthingMgmtCli

func NewAuthingMgmtCli(userPoolId string, secret string, authingHost string, tenantId *string, useEnvHost bool) *management.ManagementClient

func ProcessAuthingV3Resp

func ProcessAuthingV3Resp(statusCode int, message string, resp interface{}, api string) (bool, error)

func ProcessAuthingV3Resp2

func ProcessAuthingV3Resp2(statusCode int, message string, resp interface{}, api string) error

func RevokeToken_authing_fix

func RevokeToken_authing_fix(client *authentication.AuthenticationClient, appHost string, appId string, appSecret string, token string) (bool, error)

RevokeToken 撤回 Access token 或 Refresh token

func SendHttpRequest_fix_authing

func SendHttpRequest_fix_authing(c *management.ManagementClient, host string, userPoolId string, url string, method string, reqDto interface{}) ([]byte, error)

Types

type AuthingAuthCli

type AuthingAuthCli struct {
	UserPoolId  string
	AppId       string
	AppSecret   string
	AppHost     string
	AccessToken string
	Cli         *authentication.AuthenticationClient
}

because options of authentication.AuthenticationClient is private, we can not access it, so we wrapper this again

func (*AuthingAuthCli) GetAppTenantList

func (a *AuthingAuthCli) GetAppTenantList() (list *[]authing_model.TenantDetails, err error)

func (*AuthingAuthCli) ResetAuthCli

func (a *AuthingAuthCli) ResetAuthCli(appId, appSecret, appHost, appRedirectUri, appLogoutRedirectUri string, accessToken string)

func (*AuthingAuthCli) SetAccessToken

func (a *AuthingAuthCli) SetAccessToken(token string)

type AuthingCli

type AuthingCli struct {
	// for global general mgmt
	// UserPoolId string
	// Secret string
	Cli            *management.ManagementClient
	UserPoolId     string
	UserPoolSecret string
	TenantId       *string
	AuthingHost    string
	UseEnvHost     bool
	// for app
	AuthCli *AuthingAuthCli
}

func NewAuthingCli

func NewAuthingCli(tenantId *string, useEnvHost bool) *AuthingCli

func (*AuthingCli) ActiveUser

func (a *AuthingCli) ActiveUser(id *string) error

func (*AuthingCli) AddTenantMembers

func (a *AuthingCli) AddTenantMembers(tenantId, userId *string) error

func (*AuthingCli) AddUserToGroup

func (a *AuthingCli) AddUserToGroup(userId *string, groupCode string) error

func (*AuthingCli) AutoJoinUserToTenant

func (a *AuthingCli) AutoJoinUserToTenant(idpId string, enable bool, tenantId string) error

func (*AuthingCli) BuildClientAuthUrl

func (a *AuthingCli) BuildClientAuthUrl(appHost, state, redirectUri string, tenantId *string) string

func (*AuthingCli) BuildLogoutUrl

func (a *AuthingCli) BuildLogoutUrl(redirectUri string, idToken *string) string

func (*AuthingCli) ChangeGlobalMfa

func (a *AuthingCli) ChangeGlobalMfa(EnabledFactors []string) error

SMS,OTP,EMAIL

func (*AuthingCli) ChangeIdpConnectionMfa4Tenant

func (a *AuthingCli) ChangeIdpConnectionMfa4Tenant(idpConnectionId string, tenantId string, EnabledFactors []string) error

func (*AuthingCli) ChangeIdpConnectionState4App

func (a *AuthingCli) ChangeIdpConnectionState4App(idpConnectionId string, enable bool) error

will get 400 not work deprecated

func (*AuthingCli) ChangeIdpConnectionState4Tenant

func (a *AuthingCli) ChangeIdpConnectionState4Tenant(idpConnectionId string, enable bool, tenantId string, isCreate bool) error

func (*AuthingCli) CreateApp

func (*AuthingCli) CreateIdp

func (a *AuthingCli) CreateIdp(name, idpType string) (string, error)

func (*AuthingCli) CreateIdp4Tenant

func (a *AuthingCli) CreateIdp4Tenant(name, idpType, tenantId string) (string, error)

func (*AuthingCli) CreateIdpConnection

func (a *AuthingCli) CreateIdpConnection(idpId string, connType string, identifier string, displayName string, fields interface{}) (string, error)

func (*AuthingCli) CreateIdpConnection4Tenant

func (a *AuthingCli) CreateIdpConnection4Tenant(idpId string, tenantId string, connType string, identifier string, displayName string, fields interface{}) (string, error)

func (*AuthingCli) CreateTenant

func (*AuthingCli) CreateUser

func (a *AuthingCli) CreateUser(userInfo *authing_model.CreateUserInput) (*authing_model.User, error)

func (*AuthingCli) DeActiveUser

func (a *AuthingCli) DeActiveUser(id *string) error

func (*AuthingCli) DelApp

func (a *AuthingCli) DelApp(appId string) error

func (*AuthingCli) DeleteIdp

func (a *AuthingCli) DeleteIdp(idpId string) error

func (*AuthingCli) DeleteIdp4Tenant

func (a *AuthingCli) DeleteIdp4Tenant(idpId string, tenantId string) error

func (*AuthingCli) DeleteIdpConnection

func (a *AuthingCli) DeleteIdpConnection(idpConnectionId string) error

func (*AuthingCli) DeleteIdpConnection4Tenant

func (a *AuthingCli) DeleteIdpConnection4Tenant(idpConnectionId string, tenantId string) error

func (*AuthingCli) DeleteUser

func (a *AuthingCli) DeleteUser(id *string) (bool, error)

func (*AuthingCli) EnrollMfa

func (a *AuthingCli) EnrollMfa(factor mfa.MfaType, code string, token string) error

func (*AuthingCli) FindApp

func (a *AuthingCli) FindApp() *authing_model.Application

func (*AuthingCli) FindAppById

func (a *AuthingCli) FindAppById(appId string) *authing_model.Application

func (*AuthingCli) FindUserWhenLogin

func (a *AuthingCli) FindUserWhenLogin(appId, tenantId, key, loginType string) (interface{}, error)

func (*AuthingCli) GetAccessTokenByCode

func (a *AuthingCli) GetAccessTokenByCode(code, redirectUri string) (string, error)

func (*AuthingCli) GetAppComponentPublicConfig

func (a *AuthingCli) GetAppComponentPublicConfig(appId string, tenantId string) (interface{}, error)

func (*AuthingCli) GetAppHost

func (a *AuthingCli) GetAppHost() string

func (*AuthingCli) GetAppId

func (a *AuthingCli) GetAppId() string

func (*AuthingCli) GetAppPublicConfig

func (a *AuthingCli) GetAppPublicConfig(appId string, tenantId string) (interface{}, error)

func (*AuthingCli) GetAppTenantList

func (a *AuthingCli) GetAppTenantList() (list *[]authing_model.TenantDetails, err error)

func (*AuthingCli) GetCheckAppIsShowCode

func (a *AuthingCli) GetCheckAppIsShowCode(appId string, tenantId string) (interface{}, error)

func (*AuthingCli) GetLoginStatus

func (a *AuthingCli) GetLoginStatus(appId, tenantId string, payload interface{}) (interface{}, error)

func (*AuthingCli) GetMeInfo

func (a *AuthingCli) GetMeInfo(appId, tenantId, authorization string) (interface{}, error)

func (*AuthingCli) GetTenantList

func (a *AuthingCli) GetTenantList() (list *[]authing_model.Tenant)

获取用户池下租户列表

func (*AuthingCli) GetUser

func (a *AuthingCli) GetUser(userId *string) (*authing_model.User, error)

func (*AuthingCli) GetUserInfoByAccessToken

func (a *AuthingCli) GetUserInfoByAccessToken(code string) (*authing_model.AuthingSessionUserInfo, error)

func (*AuthingCli) ListMfaFactors

func (a *AuthingCli) ListMfaFactors() ([]authing_model.MfaFactorDto, error)

func (*AuthingCli) ListTenantApplication

func (a *AuthingCli) ListTenantApplication() (*AuthingTenantApp, error)

tenant id should set by cli init

func (*AuthingCli) ListTenantApplications

func (a *AuthingCli) ListTenantApplications() ([]AuthingTenantApp, error)

tenant id should set by cli init

func (*AuthingCli) PostAccountLogin

func (a *AuthingCli) PostAccountLogin(appId, tenantId string, payload interface{}) (interface{}, error)

func (*AuthingCli) PostEmailCodeLogin

func (a *AuthingCli) PostEmailCodeLogin(appId, tenantId string, payload interface{}) (interface{}, error)

func (*AuthingCli) PostGraphqlV2

func (a *AuthingCli) PostGraphqlV2(appId string, tenantId string, payload any) (interface{}, error)

func (*AuthingCli) PostPhoneCodeLogin

func (a *AuthingCli) PostPhoneCodeLogin(appId, tenantId string, payload interface{}) (interface{}, error)

func (*AuthingCli) PrintOptions

func (a *AuthingCli) PrintOptions()

func (*AuthingCli) RemoveTenant

func (a *AuthingCli) RemoveTenant(tenantId *string) (*string, error)

func (*AuthingCli) ResetAuthCli

func (a *AuthingCli) ResetAuthCli(appId, appSecret, appHost, appRedirectUri, appLogoutRedirectUri, accessToken string)

func (*AuthingCli) ResetCliTenantId

func (a *AuthingCli) ResetCliTenantId(tenantId string)

func (*AuthingCli) ResetMfa

func (a *AuthingCli) ResetMfa(factorId string) error

unbind

func (*AuthingCli) RevokeToken

func (a *AuthingCli) RevokeToken(token string) error

func (*AuthingCli) SendEmailWhenLogin

func (a *AuthingCli) SendEmailWhenLogin(appId, tenantId string, payload interface{}) (interface{}, error)

func (*AuthingCli) SendEnrollMfaRequest

func (a *AuthingCli) SendEnrollMfaRequest(factor mfa.MfaType, param string) (*authing_model.MfaBindResp, error)

client.SetAccessToken("USER_ACCESS_TOKEN")

func (*AuthingCli) SendSmsWhenLogin

func (a *AuthingCli) SendSmsWhenLogin(appId, tenantId string, payload interface{}) (interface{}, error)

func (*AuthingCli) SetAccessToken

func (a *AuthingCli) SetAccessToken(token string)

func (*AuthingCli) UpdateAppMfa

func (a *AuthingCli) UpdateAppMfa(enabledFactors []string, disabledFactors []string) []string

return enable factors

func (*AuthingCli) UpdateAppMfa2

func (a *AuthingCli) UpdateAppMfa2(appId string, factor string, enable bool) error

SMS,OTP,EMAIL

func (*AuthingCli) UpdateIdp

func (a *AuthingCli) UpdateIdp(idpId string, name string) error

func (*AuthingCli) UpdateIdp4Tenant

func (a *AuthingCli) UpdateIdp4Tenant(idpId string, tenantId string, name string) error

func (*AuthingCli) UpdateIdpConnection

func (a *AuthingCli) UpdateIdpConnection(idpConnectionId string, displayName string, fields interface{}) error

func (*AuthingCli) UpdateIdpConnection4Tenant

func (a *AuthingCli) UpdateIdpConnection4Tenant(idpConnectionId string, tenantId string, displayName string, fields interface{}) error

func (*AuthingCli) UpdateTenant

func (a *AuthingCli) UpdateTenant(id *string, tenantInfo *authing_model.CreateTenantRequest) (bool, error)

func (*AuthingCli) UpdateTenant_ExtraInfo

func (a *AuthingCli) UpdateTenant_ExtraInfo(tenantId string, request *authing_model.UpdateTenantExtraReq) (bool, error)

func (*AuthingCli) UpdateTenant_loginPage

func (a *AuthingCli) UpdateTenant_loginPage(tenantId string, loginCfg *authing_model.MyAuthingLoginConfig) error

passwordMethods = "phone-password", "email-password", "username-password" codeMethods = phone-code, email-code

func (*AuthingCli) UpdateUser

func (a *AuthingCli) UpdateUser(id *string, user *authing_model.UpdateUserInput) error

type AuthingTenantApp

type AuthingTenantApp struct {
	TenantAppId     string `json:"tenantAppId"`
	AppId           string `json:"appId"`
	Name            string `json:"name"`
	ApplicationType string `json:"applicationType"`
}

type ChangeExtIdpAssociationStateDto

type ChangeExtIdpAssociationStateDto struct {
	dto.ChangeExtIdpAssociationStateDto
	AppId string `json:"appId,omitempty"`
}

sdk v3 has issue, not support appId param

type IdentityDto

type IdentityDto struct {
	dto.IdentityDto
	UserInfoInIdp IdentityUserInfoInIdpDto `json:"userInfoInIdp"`
}

type IdentityUserInfoInIdpDto

type IdentityUserInfoInIdpDto struct {
	Oauth     string `json:"oauth"`
	Username  string `json:"username"`
	OpenId    string `json:"openid"`
	UnionId   string `json:"unionid"`
	Email     string `json:"email"`
	Name      string `json:"name"`
	GivenName string `json:"givenName"`
}

type UpdateLoginConfigDto

type UpdateLoginConfigDto struct {
	AutoJoin   bool   `json:"autoJoin"`
	RejectHint string `json:"rejectHint"`
}

type UserDto

type UserDto struct {
	dto.UserDto
	Oauth      string        `json:"oauth"`
	Identities []IdentityDto `json:"identities,omitempty"`
}

type UserSingleRespDto

type UserSingleRespDto struct {
	dto.UserSingleRespDto
	Data UserDto `json:"data"`
}

func GetUser_authing_fix

func GetUser_authing_fix(client *management.ManagementClient, host string, userPoolId string, reqDto *dto.GetUserDto) *UserSingleRespDto

* @summary 获取用户信息 * @description 通过用户 ID,获取用户详情,可以选择获取自定义数据、identities、选择指定用户 ID 类型等。 * @param userId 用户 ID * @param userIdType 用户 ID 类型,默认值为 `user_id`,可选值为: * - `user_id`: Authing 用户 ID,如 `6319a1504f3xxxxf214dd5b7` * - `phone`: 用户手机号 * - `email`: 用户邮箱 * - `username`: 用户名 * - `external_id`: 用户在外部系统的 ID,对应 Authing 用户信息的 `externalId` 字段 * - `identity`: 用户的外部身份源信息,格式为 `<extIdpId>:<IdInIdp>`,其中 `<extIdpId>` 为 Authing 身份源的 ID,`<IdInIdp>` 为用户在外部身份源的 ID。 * 示例值:`62f20932716fbcc10d966ee5:ou_8bae746eac07cd2564654140d2a9ac61`。 * * @param withCustomData 是否获取自定义数据 * @param withIdentities 是否获取 identities * @param withDepartmentIds 是否获取部门 ID 列表 * @returns UserSingleRespDto

Jump to

Keyboard shortcuts

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