private ResetTokenResponse GetRefreshToken(string companyId)
        {
            var requestToken = new Dictionary <string, object>
            {
                ["companyLoginId"] = companyId,
                ["username"]       = TestContext.CurrentContext.Test.Properties.Get("adminUser2Login").ToString(),
            };
            var tokenHandler = new ResetTokenManager();
            var token        = tokenHandler.ResetToken <ResetTokenResponse>(requestToken, HttpMethod.Post);

            return(token.Result);
        }
예제 #2
0
        public static PrivateApiResponse <ResetTokenResponse> GetToken()
        {
            var info         = (TestContext.CurrentContext.Test.Properties.Get(PrivateFixtureExecutorAttribute.TestAuthInfoPropertyName) as MultiItemAuthenticationInfo);
            var tokenHandler = new ResetTokenManager();
            var requestToken = new Dictionary <string, object>
            {
                ["companyLoginId"] = info.Companies.SingleOrDefault().Value.Name,
                ["username"]       = info.Users.SingleOrDefault().Value.Login,
            };

            return(tokenHandler.ResetToken <ResetTokenResponse>(requestToken, HttpMethod.Post));
        }
예제 #3
0
        public static string RefreshToken(string companyLoginId, string username)
        {
            var parameterRequest = new Dictionary <string, object>()
            {
                ["companyLoginId"] = companyLoginId,
                ["username"]       = username,
            };
            var tokenHandler = new ResetTokenManager();
            var response     = tokenHandler.ResetToken <ResetTokenResponse>(parameterRequest, System.Net.Http.HttpMethod.Post);

            //PrAssume.That(response, PrIs.SuccessfulResponse().And.HttpCode(System.Net.HttpStatusCode.OK));
            return(response.Result.Token);
        }