Google Client API
を使用して、ユーザーがログインできるドメインを制限することにより、ドメインに対して認証を行った経験がある人はいますか?
必要な情報は 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);