|
|
@ -32,7 +32,8 @@ func (client *Client) OAuthURL(ctx context.Context, scope []string) string {
|
|
|
|
|
|
|
|
|
|
|
|
// getOAuthEndpoint 根据指定的AuthURL获取详细的认证接口地址
|
|
|
|
// getOAuthEndpoint 根据指定的AuthURL获取详细的认证接口地址
|
|
|
|
func (client *Client) getOAuthEndpoint() *oauthEndpoint {
|
|
|
|
func (client *Client) getOAuthEndpoint() *oauthEndpoint {
|
|
|
|
base, err := url.Parse(client.Endpoints.OAuthURL)
|
|
|
|
//base, err := url.Parse(client.Endpoints.OAuthURL)//通过api地址判断oauth地址,OAuthURL地址留给cdn替换前缀
|
|
|
|
|
|
|
|
base, err := url.Parse(client.Endpoints.EndpointURL)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return nil
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -44,7 +45,7 @@ func (client *Client) getOAuthEndpoint() *oauthEndpoint {
|
|
|
|
case "login.live.com":
|
|
|
|
case "login.live.com":
|
|
|
|
token, _ = url.Parse("https://login.live.com/oauth20_token.srf")
|
|
|
|
token, _ = url.Parse("https://login.live.com/oauth20_token.srf")
|
|
|
|
authorize, _ = url.Parse("https://login.live.com/oauth20_authorize.srf")
|
|
|
|
authorize, _ = url.Parse("https://login.live.com/oauth20_authorize.srf")
|
|
|
|
case "login.chinacloudapi.cn":
|
|
|
|
case "microsoftgraph.chinacloudapi.cn":
|
|
|
|
client.Endpoints.isInChina = true
|
|
|
|
client.Endpoints.isInChina = true
|
|
|
|
token, _ = url.Parse("https://login.chinacloudapi.cn/common/oauth2/v2.0/token")
|
|
|
|
token, _ = url.Parse("https://login.chinacloudapi.cn/common/oauth2/v2.0/token")
|
|
|
|
authorize, _ = url.Parse("https://login.chinacloudapi.cn/common/oauth2/v2.0/authorize")
|
|
|
|
authorize, _ = url.Parse("https://login.chinacloudapi.cn/common/oauth2/v2.0/authorize")
|
|
|
|