identityserver3 - Using implicit flow to get Cookies -
using idserver3, owin, angular2, webapi, etc.
i have 2 clients setup within idsrv, 1 mvc , 1 js/angular , i'm trying achieve sso. sso works if login through mvc app (hybrid flow) since set cookies in browser , picked when navigate login via implicit flow. if first attempt login via js app (implicit flow) no cookie set, , therefore no sso achieved. how can configure idsrv set cookies when login via implicit flow hybrid flow?
edit: in other words, possible use bearer token auth webapi , cookie auth mvc , still acheive sso between two.
edit 2: since answer confirmed understanding, rephrase question once more. using implicit flow in js (angular 2) client, how can token , cookie when authenticating via auth end point in idsrv? token returned.
yes - because authentication session not maintained between idsrv , apps - between idsrv , browser.
each app must set own session - mvc via cookie. in js typically using session storage.
to go through scenario:
open mvc app
- authenticate idsrv. idsrv sets authentication cookie
- redirect mvc
- mvc sets own cookie sign in user
open js app
- authenticate idsrv. time there existing logon session. no login ui shown , tokens sent js directly
- js validates response , remembers users in local storage
every client application needs own way sign in user (cookie vs session storage). single sign on happens because there additional session idsrv (maintained idsrv own cookies).
Comments
Post a Comment