diff --git a/lib/authentication/authentication_client.go b/lib/authentication/authentication_client.go index 6181991..20e2ac8 100644 --- a/lib/authentication/authentication_client.go +++ b/lib/authentication/authentication_client.go @@ -61,6 +61,10 @@ func NewClient(appId string, secret string, host ...string) *Client { return c } +func (c *Client) SetPublicKey(publicKey string) { + constant.PublicKey = publicKey +} + // TODO func (c *Client) BuildAuthorizeUrlByOidc(params model.OidcParams) (string, error) { if c.AppId == "" { diff --git a/lib/constant/constant.go b/lib/constant/constant.go index 0782c33..d8b0e14 100644 --- a/lib/constant/constant.go +++ b/lib/constant/constant.go @@ -2,4 +2,4 @@ package constant const StringEmpty = "" -const PublicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC4xKeUgQ+Aoz7TLfAfs9+paePb5KIofVthEopwrXFkp8OCeocaTHt9ICjTT2QeJh6cZaDaArfZ873GPUn00eOIZ7Ae+TiA2BKHbCvloW3w5Lnqm70iSsUi5Fmu9/2+68GZRH9L7Mlh8cFksCicW2Y2W2uMGKl64GDcIq3au+aqJQIDAQAB" +var PublicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC4xKeUgQ+Aoz7TLfAfs9+paePb5KIofVthEopwrXFkp8OCeocaTHt9ICjTT2QeJh6cZaDaArfZ873GPUn00eOIZ7Ae+TiA2BKHbCvloW3w5Lnqm70iSsUi5Fmu9/2+68GZRH9L7Mlh8cFksCicW2Y2W2uMGKl64GDcIq3au+aqJQIDAQAB" diff --git a/lib/management/management_client.go b/lib/management/management_client.go index 813beca..8078796 100644 --- a/lib/management/management_client.go +++ b/lib/management/management_client.go @@ -59,6 +59,10 @@ func NewClient(userPoolId string, secret string, host ...string) *Client { return c } +func (c *Client) SetPublicKey(publicKey string) { + constant.PublicKey = publicKey +} + func NewClientWithError(userPoolId string, secret string, host ...string) (*Client, error) { if userPoolId == "" { return nil, errors.New("请填写 userPoolId 参数")