示例#1
0
    protected void lnkbtnYandexClick(object sender, EventArgs e)
    {
        var oAuthRequest = new OAuthRequest {
            Provider = OAuthRequest.Providers.Yandex
        };

        oAuthRequest.CreateRequest(new ClaimParameters(), false);
    }
示例#2
0
    protected void lnkbtnGoogleClick(object sender, EventArgs e)
    {
        var oAuthRequest = new OAuthRequest {
            Provider = OAuthRequest.Providers.Google
        };
        var parameters = new FetchParameters();

        parameters.OpenidUserInformation.Add(RequestParameters.AxSchemaParams.Contact.email);
        parameters.OpenidUserInformation.Add(RequestParameters.AxSchemaParams.NamePerson.First);
        parameters.OpenidUserInformation.Add(RequestParameters.AxSchemaParams.NamePerson.Last);
        oAuthRequest.CreateRequest(parameters);
    }
示例#3
0
    protected void lnkbtnMailClick(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(txtOauthUserId.Text))
        {
            return;
        }
        var userId = txtOauthUserId.Text;

        if (userId.Contains("@"))
        {
            userId = userId.Substring(0, userId.IndexOf("@"));
        }
        var oAuthRequest = new OAuthRequest {
            UserId = userId, Provider = OAuthRequest.Providers.Mail
        };

        oAuthRequest.CreateRequest(new ClaimParameters(), true);
    }
示例#4
0
        protected void lnkbtnMailClick(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtOauthUserId.Text))
            {
                return;
            }
            var userId = txtOauthUserId.Text;

            var userIdAndDomainPair = txtOauthUserId.Text.Split(new[] { '@' });

            if (userIdAndDomainPair.Length != 2)
            {
                return;
            }

            var oAuthRequest = new OAuthRequest {
                UserId = userId, Provider = OAuthRequest.Providers.Mail
            };

            oAuthRequest.CreateRequest(new ClaimParameters(), true);
        }