public IActionResult Deauthentication(DeauthenticationRequest deauthenticationRequest) { var deviceImei = deauthenticationRequest.DeviceImei; var simMsisdn = deauthenticationRequest.SimMsisdn; var simImsi = deauthenticationRequest.SimImsi; var simIccId = deauthenticationRequest.SimIccId; var account = deauthenticationRequest.Account; var simDevice = _authenticationRepository.GetSimDevice(simMsisdn, simImsi, simIccId, deviceImei); if (simDevice == null) { return(Unauthorized(NotMatchSimDevice)); } var factorCombination = _authenticationRepository.GetFactorCombination(account, simDevice); if (factorCombination == null) { //"SIM&端末認証済み"の対象レコードを削除する。(併せて"SIM&端末組合せ"のレコードを更新) _authenticationRepository.DeleteSimDeviceAuthDone(simDevice); return(Unauthorized(NotMatchMultiFactor)); } //"多要素認証済み"の対象レコードを削除する。(併せて"認証要素組合せ"のレコードを更新) _authenticationRepository.DeleteMultiFactorAuthDone(factorCombination); CreateDeauthentication(factorCombination); return(Ok()); }
protected HttpResponseMessage PostDeauthentication(DeauthenticationRequest deauthenticationRequest) { var url = "api/deauthentication"; var httpRequestMessage = new HttpRequestMessage(HttpMethod.Post, url) { Content = new StringContent(JsonConvert.SerializeObject(deauthenticationRequest), Encoding.UTF8, MediaTypeNames.Application.Json) }; return(Post(httpRequestMessage)); }
public Case21(DeauthenticationRequest deauthenticationRequest, HttpStatusCode httpStatusCode) : base(deauthenticationRequest, httpStatusCode) { }
protected DeauthenticationTestCase(DeauthenticationRequest deauthenticationRequest, HttpStatusCode httpStatusCode) { _deauthenticationRequest = deauthenticationRequest; _httpStatusCode = httpStatusCode; }
public static void Assert09(AuthControllerTestRepository authControllerTestRepository, HttpResponseMessage acualRessult, DeauthenticationRequest request) { if (request == null) { throw new ArgumentNullException(nameof(request)); } Assert.Equal(HttpStatusCode.OK, acualRessult.StatusCode); Assert.Equal("", acualRessult.Content.ReadAsStringAsync().Result); //TODO //Debug.Assert(request.AuthId != null, "request.AuthId != null"); //認証成功でSimDeviceAuthenticationStateDoneがなくなっているのでAuIdで探すのは無理 var simDeviceList = authControllerTestRepository.GetSimDeviceList(); Assert.Equal(3, simDeviceList.Count); var factorCombinationList = authControllerTestRepository.GetFactorCombinationList(); Assert.Equal(2, factorCombinationList.Count); var multiFactorAuthenticationStateDones = authControllerTestRepository.GetMultiFatorAuthenticationDone(); Assert.Equal(1, multiFactorAuthenticationStateDones.Count); var radreply = authControllerTestRepository.GetRadreply("user1@jincreek2"); Assert.Equal("Nw2Address", radreply.Value); }