2020-08-07 16:22:28 +08:00
|
|
|
package sso
|
|
|
|
|
2020-09-23 20:23:35 +08:00
|
|
|
import (
|
|
|
|
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
|
|
|
|
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
|
|
|
)
|
2020-08-07 16:22:28 +08:00
|
|
|
|
|
|
|
const (
|
|
|
|
VERSION = "2020-08-07"
|
|
|
|
)
|
|
|
|
|
2020-09-23 20:23:35 +08:00
|
|
|
var HOST = requests.Host{
|
|
|
|
Default: "sso",
|
|
|
|
}
|
|
|
|
|
2020-08-07 16:22:28 +08:00
|
|
|
type Client struct {
|
|
|
|
sdk.Client
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *Client) CodeAuth(req *CodeAuthRequest) (response *CodeAuthResponse, err error) {
|
|
|
|
response = CreateCodeAuthResponse()
|
|
|
|
err = c.DoAction(req, response)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *Client) GetUserInfo(req *GetUserInfoRequest) (response *GetUserInfoResponse, err error) {
|
|
|
|
response = CreateGetUserInfoResponse()
|
|
|
|
err = c.DoAction(req, response)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *Client) RefreshToken(req *RefreshTokenRequest) (response *RefreshTokenResponse, err error) {
|
|
|
|
response = CreateRefreshTokenResponse()
|
|
|
|
err = c.DoAction(req, response)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2020-08-10 12:30:34 +08:00
|
|
|
func (c *Client) SearchUser(req *SearchUserRequest) (response *SearchUserResponse, err error) {
|
|
|
|
response = CreateSearchUserResponse()
|
|
|
|
err = c.DoAction(req, response)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2020-08-07 16:22:28 +08:00
|
|
|
func NewClientWithAccessKey(accesskey, secrect, source string) (client *Client, err error) {
|
|
|
|
client = &Client{}
|
|
|
|
err = client.InitWithAccessKey(accesskey, secrect, source)
|
|
|
|
return
|
|
|
|
}
|