0
は自分自身が私のAXリクエストの応答にDotnetopenauthGoogleのopenID問題トークンはありますか?
により、C#での認証Exchangeを使用して自分のアプリケーションに私の疑問は以下、
- をSSOをimplementented、私は任意のトークンを受け取るいけません。任意のパラメータを送信する必要がありますか?
- 私のアプリケーションでは毎回プロバイダにサインインする必要がありますが、ユーザが次回から自動的にサインインするときにチェックボックスをクリックするとすぐにユーザにIDとパスワードを尋ねることはありません。
- MyopenIdの場合、AX fetchResponse null。それは簡単な登録だけをサポートしていますか?
リクエストコード:
IAuthenticationRequest request = openid.CreateRequest(txt_openid_identifier.Text);
var fetchRequest = new FetchRequest();
fetchRequest.Attributes.Clear();
fetchRequest.Attributes.AddRequired(WellKnownAttributes.Contact.Email);
fetchRequest.Attributes.AddRequired(WellKnownAttributes.Name.First);
fetchRequest.Attributes.AddRequired(WellKnownAttributes.Name.Last); fetchRequest.Attributes.AddRequired(WellKnownAttributes.Contact.HomeAddress.Country);
request.AddExtension(fetchRequest);
// Issue request to OP
request.RedirectToProvider();
応答コード:
using (var openid = new OpenIdRelyingParty())
{
var response = openid.GetResponse();
if (response == null) return;
switch (response.Status)
{
case AuthenticationStatus.Authenticated:
string emailID = string.Empty;
Session["email"] = string.Empty;
Session["name"] = string.Empty;
Session["country"] = string.Empty;
Session["Accesskey"] = string.Empty;
Session["SecretAccesskey"] = string.Empty;
var fetchResponse = response.GetExtension<FetchResponse>();
if (fetchResponse.Attributes.Contains(WellKnownAttributes.Contact.Email))
{
IList<string> emailAddresses =
fetchResponse.Attributes[WellKnownAttributes.Contact.Email].Values;
emailID = emailAddresses.Count > 0 ? emailAddresses[0] : null;
}
else
emailID = string.Empty;
}
}