This commit is contained in:
@@ -26,9 +26,33 @@ namespace raven_integration
|
|||||||
d.login = "BOGUS";
|
d.login = "BOGUS";
|
||||||
d.password = "ACCOUNT";
|
d.password = "ACCOUNT";
|
||||||
ApiResponse a = await Util.PostAsync("Auth", null, d.ToString());
|
ApiResponse a = await Util.PostAsync("Auth", null, d.ToString());
|
||||||
Util.ValidateErrorCodeResponse(a,2003,401);
|
Util.ValidateErrorCodeResponse(a, 2003, 401);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[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
|
}//eoc
|
||||||
|
|||||||
Reference in New Issue
Block a user