示例#1
0
        private void OAuthAuthWithSocialNetworkAccessToken(string accessToken, string accessTokenSecret, string openId, string providerName, string oauthState, Action <string> onSuccess, Action <Error> onError)
        {
            var state = oauthState ?? DEFAULT_OAUTH_STATE;
            var url   = string.Format(URL_USER_OAUTH_SOCIAL_NETWORK_TOKEN_AUTH, providerName, XsollaSettings.OAuthClientId, state);

            var requestData = new SocialNetworkAccessTokenRequest {
                access_token        = accessToken,
                access_token_secret = accessTokenSecret,
                openId = openId
            };

            WebRequestHelper.Instance.PostRequest(SdkType.Login, url, requestData, onSuccess, onError, Error.LoginErrors);
        }
示例#2
0
        private void JwtAuthWithSocialNetworkAccessToken(string accessToken, string accessTokenSecret, string openId, string providerName, string payload, Action <string> onSuccess, Action <Error> onError)
        {
            var tokenInvalidationFlag = XsollaSettings.JwtTokenInvalidationEnabled ? "1" : "0";
            var url = string.Format(URL_USER_SOCIAL_NETWORK_TOKEN_AUTH, providerName, XsollaSettings.LoginId, payload, tokenInvalidationFlag);

            var requestData = new SocialNetworkAccessTokenRequest {
                access_token        = accessToken,
                access_token_secret = accessTokenSecret,
                openId = openId
            };

            WebRequestHelper.Instance.PostRequest(SdkType.Login, url, requestData, (TokenEntity result) => { onSuccess?.Invoke(result.token); }, onError, Error.LoginErrors);
        }