【发布时间】:2013-01-15 11:17:04
【问题描述】:
有没有人有任何使用Google Client API通过限制用户可以登录的域来授权他们的域的经验?
需要的titbit似乎是一个qs参数:hd='[Domain name]'
但在 OAuth2Parameters 参数对象中没有类似的东西
var oap = new OAuth2Parameters
{
AccessToken = Current == null ? null : Current.AccessToken,
RefreshToken = Current == null ? null : Current.RefreshToken,
ClientId = GoogleClientId,
ClientSecret = GoogleClientSecret,
Scope = "https://spreadsheets.google.com/feeds https://docs.google.com/feeds https://www.googleapis.com/auth/userinfo.email",
RedirectUri = HttpContext.Current.Request.Url.Scheme.Concatenate("://", HttpContext.Current.Request.Url.Authority, "/Builder/Authentication/Receive"),
AccessType = "offline" //ensures a refresh token (tho not currently working),
*HD = //Hmm if only... :(((*
};
var authorizationUrl = OAuthUtil.CreateOAuth2AuthorizationUrl(oap);
return Redirect(authorizationUrl);
【问题讨论】:
标签: oauth-2.0 google-api-client