public void Add_the_user_identity_object_to_Owin_context_when_the_request_originates_from_an_end_user_request() { AppFunc pipelineFunc(AppFunc next) => IdToken.Middleware(next); // online generated JWT token with secret key is "secret" const string testUserJwt = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJPbmxpbmUgSldUIEJ1aWxkZXIiLCJpYXQiOjE1MzQyMjA3ODEsImV4cCI6MTU2NTc1Njc4MSwiYXVkIjoid3d3LmV4YW1wbGUuY29tIiwic3ViIjoianJvY2tldEBleGFtcGxlLmNvbSIsIkdpdmVuTmFtZSI6IkpvaG5ueSIsIlN1cm5hbWUiOiJSb2NrZXQiLCJFbWFpbCI6Impyb2NrZXRAZXhhbXBsZS5jb20iLCJSb2xlIjpbIk1hbmFnZXIiLCJQcm9qZWN0IEFkbWluaXN0cmF0b3IiXX0.XYq-fVo5N-GWgRENl2yxUAc6xqqjkvoUiOf-GY0mQjU"; var pipeline = pipelineFunc(m_NoOp); var ctx = SetupOwinTestEnvironment(); ctx.Request.Headers.Append("uservice-end-user", testUserJwt); var env = ctx.Environment; pipeline(env); var principle = ctx.Get <ClaimsPrincipal>("pos_end_user"); Assert.NotNull(principle); }