{"action":"created","issue":{"url":"https://api.github.com/repos/IdentityServer/IdentityServer4.AspNetIdentity/issues/18","repository_url":"https://api.github.com/repos/IdentityServer/IdentityServer4.AspNetIdentity","labels_url":"https://api.github.com/repos/IdentityServer/IdentityServer4.AspNetIdentity/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/IdentityServer/IdentityServer4.AspNetIdentity/issues/18/comments","events_url":"https://api.github.com/repos/IdentityServer/IdentityServer4.AspNetIdentity/issues/18/events","html_url":"https://github.com/IdentityServer/IdentityServer4.AspNetIdentity/issues/18","id":190556005,"number":18,"title":"Using AspNetIdentity along with External Login Examples","user":{"login":"JChaneyGuardian","id":19995060,"avatar_url":"https://avatars.githubusercontent.com/u/19995060?v=3","gravatar_id":"","url":"https://api.github.com/users/JChaneyGuardian","html_url":"https://github.com/JChaneyGuardian","followers_url":"https://api.github.com/users/JChaneyGuardian/followers","following_url":"https://api.github.com/users/JChaneyGuardian/following{/other_user}","gists_url":"https://api.github.com/users/JChaneyGuardian/gists{/gist_id}","starred_url":"https://api.github.com/users/JChaneyGuardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JChaneyGuardian/subscriptions","organizations_url":"https://api.github.com/users/JChaneyGuardian/orgs","repos_url":"https://api.github.com/users/JChaneyGuardian/repos","events_url":"https://api.github.com/users/JChaneyGuardian/events{/privacy}","received_events_url":"https://api.github.com/users/JChaneyGuardian/received_events","type":"User","site_admin":false},"labels":[{"id":436167103,"url":"https://api.github.com/repos/IdentityServer/IdentityServer4.AspNetIdentity/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-20T12:40:49Z","updated_at":"2016-11-28T14:46:52Z","closed_at":null,"body":"I was working through the Quick Start example for IdentityServer4 (Thank you!), and, I got to 6_aspnet_identity, and, got it working just fine. I then tried to add the External Provider examples, Google and demo.identityserver.io, to the new IdentityServerWithAspNetIdentity project. When I try to use either External Provider the call to _signInManager.GetExternalLoginInfoAsync() in AccountController.ExternalLoginCallback() always returns null.\r\n\r\nI copied the code from the original IdentityServer project's AccountController.ExternalLoginCallback() to read the info and it is able to pull the information and it is working to get the login information from Google.\r\n\r\nI've walked through the instructions on setting up the external providers from the QuickStart as well as from step 4 instructions. I've tried changing the order of when things are registered in Startup.Configuration(), but, I just am not getting anywhere with this.\r\n\r\nI know it's probably something I'm just not understanding, and, I am hoping someone can help me out.\r\n\r\nThe attached ZIP contains my Startup.cs, Config.cs, Program.cs, AccountController.cs and project.json.\r\n\r\nIt also contains a Word Document that I pasted screen shots from Firebug with the request/response headers from the google signon and ExternalCallback calls for both the original setup working with the InMemory IdentityServer Quick Start and the ASPNetIdentity version that is not working.\r\n\r\n[IdenityServerWithAspNetIdentity.Setup.zip](https://github.com/IdentityServer/IdentityServer4.AspNetIdentity/files/602002/IdenityServerWithAspNetIdentity.Setup.zip)\r\n\r\nThanks for any help or advice you can give.\r\n\r\nJeff Chaney"},"comment":{"url":"https://api.github.com/repos/IdentityServer/IdentityServer4.AspNetIdentity/issues/comments/263289142","html_url":"https://github.com/IdentityServer/IdentityServer4.AspNetIdentity/issues/18#issuecomment-263289142","issue_url":"https://api.github.com/repos/IdentityServer/IdentityServer4.AspNetIdentity/issues/18","id":263289142,"user":{"login":"jeffchaney1","id":18230485,"avatar_url":"https://avatars.githubusercontent.com/u/18230485?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffchaney1","html_url":"https://github.com/jeffchaney1","followers_url":"https://api.github.com/users/jeffchaney1/followers","following_url":"https://api.github.com/users/jeffchaney1/following{/other_user}","gists_url":"https://api.github.com/users/jeffchaney1/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffchaney1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffchaney1/subscriptions","organizations_url":"https://api.github.com/users/jeffchaney1/orgs","repos_url":"https://api.github.com/users/jeffchaney1/repos","events_url":"https://api.github.com/users/jeffchaney1/events{/privacy}","received_events_url":"https://api.github.com/users/jeffchaney1/received_events","type":"User","site_admin":false},"created_at":"2016-11-28T14:46:52Z","updated_at":"2016-11-28T14:46:52Z","body":"Moving the setup of the CookieAuthenticationOptions into the ConfigureSevices() under services.AddIdentity() worked.  Thank you very much.  \r\n\r\n```\r\n            services.AddIdentity<ApplicationUser, IdentityRole>(\r\n            // Added the following lines based on email from Developer-Kostas\r\n                config => {\r\n                config.Cookies.ExternalCookie = new CookieAuthenticationOptions\r\n                {\r\n                    AuthenticationScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme,\r\n\r\n                    AutomaticAuthenticate = false,\r\n                    AutomaticChallenge = false\r\n                };\r\n            }\r\n            // ********************************************************************\r\n                )\r\n                .AddEntityFrameworkStores<ApplicationDbContext>()\r\n                .AddDefaultTokenProviders();\r\n```\r\n\r\nI left the code in Configure() that calls UseCookieAuthentication().  Do I still need that?\r\n\r\n```\r\n            // NOTE: THE FOLLOWING CAME FROM https://github.com/IdentityServer/IdentityServer4.Quickstart.UI/blob/dev/README.md\r\n            // cookie middleware for temporarily storing the outcome of the external authentication\r\n            app.UseCookieAuthentication(new CookieAuthenticationOptions\r\n            {\r\n                AuthenticationScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme,\r\n                //AutomaticAuthenticate = false,\r\n                //AutomaticChallenge = false\r\n            });\r\n```\r\n"}}
{"actor":{"display_login":"jeffchaney1"}}