{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Localization/issues/136","labels_url":"https://api.github.com/repos/aspnet/Localization/issues/136/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Localization/issues/136/comments","events_url":"https://api.github.com/repos/aspnet/Localization/issues/136/events","html_url":"https://github.com/aspnet/Localization/issues/136","id":114219564,"number":136,"title":"Where in the middleware should app.UseRequestLocalization() be called?","user":{"login":"jerriep","id":1006420,"avatar_url":"https://avatars.githubusercontent.com/u/1006420?v=3","gravatar_id":"","url":"https://api.github.com/users/jerriep","html_url":"https://github.com/jerriep","followers_url":"https://api.github.com/users/jerriep/followers","following_url":"https://api.github.com/users/jerriep/following{/other_user}","gists_url":"https://api.github.com/users/jerriep/gists{/gist_id}","starred_url":"https://api.github.com/users/jerriep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerriep/subscriptions","organizations_url":"https://api.github.com/users/jerriep/orgs","repos_url":"https://api.github.com/users/jerriep/repos","events_url":"https://api.github.com/users/jerriep/events{/privacy}","received_events_url":"https://api.github.com/users/jerriep/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-10-30T07:53:37Z","updated_at":"2015-10-30T10:31:02Z","closed_at":null,"body":"I have an application which uses the localization middleware. Previously I would call `app.UseRequestLocalization()` very early in the `Configure` method:\r\n\r\n```\r\npublic void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)\r\n{\r\n    loggerFactory.MinimumLevel = LogLevel.Information;\r\n    loggerFactory.AddConsole();\r\n    loggerFactory.AddDebug();\r\n\r\n   app.UseRequestLocalization();\r\n\r\n   // Rest of the method...\r\n}\r\n```\r\n\r\nBut I have written a custom `RequestCultureProvider` which read the culture from the user info. Well actually it reads it from a claim on the ClaimsPrincipal (i.e. HttpContext.User property).\r\n\r\nThing is however that if put the call to `app.UseRequestLocalization()` early in the methodm the user is not set because the Identity middleware has not executed yet. So I need to move it to somewhere after the call to `app.UseIdentity()`, then all works fine.\r\n\r\nI am curious however whether there will be some sort of obviously bad side effect I may suffer when moving the Localization middleware further down the middleware pipeline?"},"comment":{"url":"https://api.github.com/repos/aspnet/Localization/issues/comments/152487403","html_url":"https://github.com/aspnet/Localization/issues/136#issuecomment-152487403","issue_url":"https://api.github.com/repos/aspnet/Localization/issues/136","id":152487403,"user":{"login":"hishamco","id":3237266,"avatar_url":"https://avatars.githubusercontent.com/u/3237266?v=3","gravatar_id":"","url":"https://api.github.com/users/hishamco","html_url":"https://github.com/hishamco","followers_url":"https://api.github.com/users/hishamco/followers","following_url":"https://api.github.com/users/hishamco/following{/other_user}","gists_url":"https://api.github.com/users/hishamco/gists{/gist_id}","starred_url":"https://api.github.com/users/hishamco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hishamco/subscriptions","organizations_url":"https://api.github.com/users/hishamco/orgs","repos_url":"https://api.github.com/users/hishamco/repos","events_url":"https://api.github.com/users/hishamco/events{/privacy}","received_events_url":"https://api.github.com/users/hishamco/received_events","type":"User","site_admin":false},"created_at":"2015-10-30T10:31:02Z","updated_at":"2015-10-30T10:31:02Z","body":"I'm not quite sure if there's side effect, IMHO you should use ```UseRequestLocalization``` before the middlewares that may need localization such as ```UseMvcWithDefaultRoute```"}}