diff --git a/Authentication/Auth.cs b/Authentication/Auth.cs index 9e9233f..a836663 100644 --- a/Authentication/Auth.cs +++ b/Authentication/Auth.cs @@ -26,9 +26,33 @@ namespace raven_integration d.login = "BOGUS"; d.password = "ACCOUNT"; ApiResponse a = await Util.PostAsync("Auth", null, d.ToString()); - Util.ValidateErrorCodeResponse(a,2003,401); + Util.ValidateErrorCodeResponse(a, 2003, 401); } + + + /// + /// + /// + [Fact] + public async void JWTExpiredTokenShouldFail() + { + + //Valid auth token but expired: + var ValidButExpiredToken="Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOiIxNTQ0NTU5NzAwIiwiZXhwIjoiMTU0NzE1MTcwMCIsImlzcyI6ImF5YW5vdmEuY29tIiwiaWQiOiIxIiwiYXlhbm92YS9yb2xlcyI6IjMyNzY3In0.fMq_8Dvia63rzN_U2zjczPvUNM40OEAeI4VOeV6ulGw"; + + //Expect status code 401 and result: + // {{ + // "error": { + // "code": "2003", + // "message": "Authentication failed" + // } + // }} + ApiResponse a = await Util.GetAsync("Locale/picklist", ValidButExpiredToken);//lowest level test user because there are no limits on this route except to be authenticated + Util.ValidateHTTPStatusCode(a, 401); + } + + //================================================== }//eoc