{"action":"created","issue":{"url":"https://api.github.com/repos/IdentityServer/IdentityServer4.Samples/issues/122","repository_url":"https://api.github.com/repos/IdentityServer/IdentityServer4.Samples","labels_url":"https://api.github.com/repos/IdentityServer/IdentityServer4.Samples/issues/122/labels{/name}","comments_url":"https://api.github.com/repos/IdentityServer/IdentityServer4.Samples/issues/122/comments","events_url":"https://api.github.com/repos/IdentityServer/IdentityServer4.Samples/issues/122/events","html_url":"https://github.com/IdentityServer/IdentityServer4.Samples/issues/122","id":206977638,"number":122,"title":"Using IProfileService when sign-in by Google OAuth","user":{"login":"mrtaikandi","id":3823325,"avatar_url":"https://avatars.githubusercontent.com/u/3823325?v=3","gravatar_id":"","url":"https://api.github.com/users/mrtaikandi","html_url":"https://github.com/mrtaikandi","followers_url":"https://api.github.com/users/mrtaikandi/followers","following_url":"https://api.github.com/users/mrtaikandi/following{/other_user}","gists_url":"https://api.github.com/users/mrtaikandi/gists{/gist_id}","starred_url":"https://api.github.com/users/mrtaikandi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrtaikandi/subscriptions","organizations_url":"https://api.github.com/users/mrtaikandi/orgs","repos_url":"https://api.github.com/users/mrtaikandi/repos","events_url":"https://api.github.com/users/mrtaikandi/events{/privacy}","received_events_url":"https://api.github.com/users/mrtaikandi/received_events","type":"User","site_admin":false},"labels":[{"id":295297530,"url":"https://api.github.com/repos/IdentityServer/IdentityServer4.Samples/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-02-11T12:42:44Z","updated_at":"2017-02-11T15:57:41Z","closed_at":null,"body":"I'm trying to change the IdentityServer4 AspNetIdentity sample to be able to login from both local created users and Google. \r\n\r\nI was able to do this by adding Google authentication: \r\n\r\n            app.UseIdentity();\r\n            app.UseIdentityServer();\r\n           \r\n            var cookieScheme = app.ApplicationServices.GetRequiredService<IOptions<IdentityOptions>>().Value.Cookies.ExternalCookieAuthenticationScheme;\r\n\r\n            // Add external authentication middleware below. To configure them please see http://go.microsoft.com/fwlink/?LinkID=532715\r\n            app.UseGoogleAuthentication(new GoogleOptions\r\n            {\r\n                AuthenticationScheme = \"Google\",\r\n                SignInScheme = cookieScheme,\r\n                ClientId = \"client_id\",\r\n                ClientSecret = \"client_secret\"\r\n            });\r\n\r\nAs expected the Home view shows correct user claims: \r\n\r\nsub\r\nc51da331-0348-45dd-352f-08d4526f6266\r\nname\r\nEMAIL@gmail.com\r\nAspNet.Identity.SecurityStamp\r\n568a167f-a431-4f70-ba66-918f99e95eef\r\nidp\r\nGoogle\r\namr\r\nexternal\r\nauth_time\r\n1486815555\r\n\r\nWhen user signs in for the first time using Google account I add some information to the database and I thought I can add them to the user claims by using a custom IProfileService implementation and configuring IdentityServer to use my custom IProfileService:\r\n\r\n             var builder = services.AddIdentityServer();\r\n             builder.AddTemporarySigningCredential();\r\n\r\n            builder.AddConfigurationStore(b => b.UseSqlServer(connectionString, options => options.MigrationsAssembly(migrationAssembly)));\r\n            builder.AddOperationalStore(b => b.UseSqlServer(connectionString, options => options.MigrationsAssembly(migrationAssembly)));\r\n            builder.AddAspNetIdentity<MyUser>();\r\n            builder.AddProfileService<MyCustomProfileService>();\r\n\r\nBut now when I navigate to Home page the user claims remain the same and even GetProfileDataAsync method will not hit. \r\n\r\nI appreciate if anyone can tell me what is it like this. "},"comment":{"url":"https://api.github.com/repos/IdentityServer/IdentityServer4.Samples/issues/comments/279154918","html_url":"https://github.com/IdentityServer/IdentityServer4.Samples/issues/122#issuecomment-279154918","issue_url":"https://api.github.com/repos/IdentityServer/IdentityServer4.Samples/issues/122","id":279154918,"user":{"login":"brockallen","id":649492,"avatar_url":"https://avatars.githubusercontent.com/u/649492?v=3","gravatar_id":"","url":"https://api.github.com/users/brockallen","html_url":"https://github.com/brockallen","followers_url":"https://api.github.com/users/brockallen/followers","following_url":"https://api.github.com/users/brockallen/following{/other_user}","gists_url":"https://api.github.com/users/brockallen/gists{/gist_id}","starred_url":"https://api.github.com/users/brockallen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brockallen/subscriptions","organizations_url":"https://api.github.com/users/brockallen/orgs","repos_url":"https://api.github.com/users/brockallen/repos","events_url":"https://api.github.com/users/brockallen/events{/privacy}","received_events_url":"https://api.github.com/users/brockallen/received_events","type":"User","site_admin":false},"created_at":"2017-02-11T15:57:41Z","updated_at":"2017-02-11T15:57:41Z","body":"> In this case, don't you agree that I should add every additional claims I want to the database (using UserManager) during user's first login?\r\n\r\nIf you want/trust those claims from the external provider, yes."}}
{"actor":{"display_login":"brockallen"}}