{"action":"created","issue":{"url":"https://api.github.com/repos/IdentityServer/IdentityServer4/issues/42","repository_url":"https://api.github.com/repos/IdentityServer/IdentityServer4","labels_url":"https://api.github.com/repos/IdentityServer/IdentityServer4/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/IdentityServer/IdentityServer4/issues/42/comments","events_url":"https://api.github.com/repos/IdentityServer/IdentityServer4/issues/42/events","html_url":"https://github.com/IdentityServer/IdentityServer4/issues/42","id":134641133,"number":42,"title":"OpenId Connect Hybrid flow + SPA + Backend  (+mobile app) ","user":{"login":"kapoc","id":6131152,"avatar_url":"https://avatars.githubusercontent.com/u/6131152?v=3","gravatar_id":"","url":"https://api.github.com/users/kapoc","html_url":"https://github.com/kapoc","followers_url":"https://api.github.com/users/kapoc/followers","following_url":"https://api.github.com/users/kapoc/following{/other_user}","gists_url":"https://api.github.com/users/kapoc/gists{/gist_id}","starred_url":"https://api.github.com/users/kapoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kapoc/subscriptions","organizations_url":"https://api.github.com/users/kapoc/orgs","repos_url":"https://api.github.com/users/kapoc/repos","events_url":"https://api.github.com/users/kapoc/events{/privacy}","received_events_url":"https://api.github.com/users/kapoc/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/IdentityServer/IdentityServer4/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-02-18T17:19:59Z","updated_at":"2016-02-22T09:22:26Z","closed_at":null,"body":"I have SPA (angular.js) that is communicating with backend API. What I want to implement is OpenId Connect's Hybrid flow. \r\n\r\nI was doing this based on this sample - https://github.com/IdentityServer/IdentityServer4.Samples/tree/dev/Mvc/src/IdSvrHost\r\n\r\nIt all works well if I put [Authorize] attribute on some controller & try to access it - I'm being redirected to login screen and can sign in. I'm using AspNet OpenId Connect middleware for logging user in and accessing his claims. \r\n\r\nThe problem is that I want to have a simple login screen with no redirects after being unauthorized user (i.e. first time user enters the application and clicks 'Log in' button). \r\n\r\nWhat I can't wrap my head around is this (from the sample mentioned above, LoginController.cs): \r\n\r\n```\r\n        [HttpGet(Constants.RoutePaths.Login, Name = \"Login\")]\r\n        public async Task<IActionResult> Index(string id)\r\n        {\r\n            var vm = new LoginViewModel();\r\n\r\n            if (id != null)\r\n            {\r\n                var request = await _signInInteraction.GetRequestAsync(id);\r\n                if (request != null)\r\n                {\r\n                    vm.Username = request.LoginHint;\r\n                    vm.SignInId = id;\r\n                }\r\n            }\r\n\r\n            return View(vm);\r\n        }\r\n```\r\nLogin screen gets this SignInId cookie & id (during the unauthorized redirect) that is being later used during the actual logging in (for SignInResult).\r\n\r\n1) Is Hybrid flow best suited for having SPA that is used together with Backend API? Both the client & identity server here are ours so they're trusted. \r\n2) If SignInId is not necessary, then what could be the approach to implemented hybrid flow with blank login form? \r\n3) If SignInId is necessary, then what could be the workflow for having blank log in screen & using this approach? Redirecting with [Authorize] is, sadly, the only option that I see right now\r\n4) Can this approach (OpenId Connect's hybrid flow) work well with mobile apps? (having in mind cookies, storage, etc) \r\n5) Currently Identity Server is inside another project (next to my API) - would anything change if both API & Identity Server would be inside the same project (self hosted) or this doesn't affect anything? "},"comment":{"url":"https://api.github.com/repos/IdentityServer/IdentityServer4/issues/comments/187087825","html_url":"https://github.com/IdentityServer/IdentityServer4/issues/42#issuecomment-187087825","issue_url":"https://api.github.com/repos/IdentityServer/IdentityServer4/issues/42","id":187087825,"user":{"login":"xabikos","id":487416,"avatar_url":"https://avatars.githubusercontent.com/u/487416?v=3","gravatar_id":"","url":"https://api.github.com/users/xabikos","html_url":"https://github.com/xabikos","followers_url":"https://api.github.com/users/xabikos/followers","following_url":"https://api.github.com/users/xabikos/following{/other_user}","gists_url":"https://api.github.com/users/xabikos/gists{/gist_id}","starred_url":"https://api.github.com/users/xabikos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xabikos/subscriptions","organizations_url":"https://api.github.com/users/xabikos/orgs","repos_url":"https://api.github.com/users/xabikos/repos","events_url":"https://api.github.com/users/xabikos/events{/privacy}","received_events_url":"https://api.github.com/users/xabikos/received_events","type":"User","site_admin":false},"created_at":"2016-02-22T09:22:26Z","updated_at":"2016-02-22T09:22:26Z","body":"Thanks for the answer. It's more clear for me now. "}}