{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Scaffolding/issues/725","repository_url":"https://api.github.com/repos/aspnet/Scaffolding","labels_url":"https://api.github.com/repos/aspnet/Scaffolding/issues/725/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Scaffolding/issues/725/comments","events_url":"https://api.github.com/repos/aspnet/Scaffolding/issues/725/events","html_url":"https://github.com/aspnet/Scaffolding/issues/725","id":311742676,"number":725,"title":"[Preview2-Validation] Identity scaffolding's IdentityHostingStartup should use the simpler `AddDefaultIdentity<TUser>` extension","user":{"login":"kichalla","id":6559784,"avatar_url":"https://avatars3.githubusercontent.com/u/6559784?v=4","gravatar_id":"","url":"https://api.github.com/users/kichalla","html_url":"https://github.com/kichalla","followers_url":"https://api.github.com/users/kichalla/followers","following_url":"https://api.github.com/users/kichalla/following{/other_user}","gists_url":"https://api.github.com/users/kichalla/gists{/gist_id}","starred_url":"https://api.github.com/users/kichalla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kichalla/subscriptions","organizations_url":"https://api.github.com/users/kichalla/orgs","repos_url":"https://api.github.com/users/kichalla/repos","events_url":"https://api.github.com/users/kichalla/events{/privacy}","received_events_url":"https://api.github.com/users/kichalla/received_events","type":"User","site_admin":false},"labels":[{"id":110141954,"url":"https://api.github.com/repos/aspnet/Scaffolding/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-04-05T19:39:12Z","updated_at":"2018-04-11T14:40:38Z","closed_at":null,"author_association":"MEMBER","body":"Following is how it looks like for code that is generated in `IdentityHostingStartup` file:\r\n```c#\r\nservices.AddIdentity<RazorPagesNoAuthenticationUser, IdentityRole>()\r\n    .AddEntityFrameworkStores<RazorPagesNoAuthenticationContext>()\r\n    .AddDefaultUI()\r\n    .AddDefaultTokenProviders();\r\n```\r\n\r\nThis has the problem that if someone has their own custom IdentityUser and role (ex: `ApplicationUser: IdentityUser<Guid>, ApplicationRole: IdentityRole<Guid>`) and chose the `ApplicationUser` model, then using the generated `IdentityRole` would be incorrect.\r\n\r\nInstead we should use the simpler extension `AddDefaultIdentity<TUser>` which just accepts a user type, so it would be\r\n```c#\r\nservices.AddDefaultIdentity<RazorPagesNoAuthenticationUser>()\r\n    .AddEntityFrameworkStores<RazorPagesNoAuthenticationContext>()\r\n```"},"comment":{"url":"https://api.github.com/repos/aspnet/Scaffolding/issues/comments/380476974","html_url":"https://github.com/aspnet/Scaffolding/issues/725#issuecomment-380476974","issue_url":"https://api.github.com/repos/aspnet/Scaffolding/issues/725","id":380476974,"user":{"login":"javiercn","id":6995051,"avatar_url":"https://avatars2.githubusercontent.com/u/6995051?v=4","gravatar_id":"","url":"https://api.github.com/users/javiercn","html_url":"https://github.com/javiercn","followers_url":"https://api.github.com/users/javiercn/followers","following_url":"https://api.github.com/users/javiercn/following{/other_user}","gists_url":"https://api.github.com/users/javiercn/gists{/gist_id}","starred_url":"https://api.github.com/users/javiercn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javiercn/subscriptions","organizations_url":"https://api.github.com/users/javiercn/orgs","repos_url":"https://api.github.com/users/javiercn/repos","events_url":"https://api.github.com/users/javiercn/events{/privacy}","received_events_url":"https://api.github.com/users/javiercn/received_events","type":"User","site_admin":false},"created_at":"2018-04-11T14:40:38Z","updated_at":"2018-04-11T14:40:38Z","author_association":"MEMBER","body":"@HaoK "}}
{"actor":{"display_login":"javiercn"}}