Redirecting to client after login does not recognise that the user has been logged in (TypeScript client and BFF (3.x)) #373
-
|
Hi all, TIA. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
|
Can you check the network traffic in the browser dev tools? The IdentityServer redirects back to the BFF (default path |
Beta Was this translation helpful? Give feedback.
-
|
The issue is a cross-domain cookie problem . Your BFF sets the session cookie ( The BFF pattern requires same-domain deployment to leverage secure, http only cookies for session management. You can read more about BFF and hosting models here: https://docs.duendesoftware.com/bff/architecture/ui-hosting/#host-the-ui-separately. The important bits from the docs is
|
Beta Was this translation helpful? Give feedback.
The issue is a cross-domain cookie problem . Your BFF sets the session cookie (
__our-bff) onbff.someapplication.somewhere.com, but then redirects tohttp://localhost:9000/. Browsers cannot share cookies across different domains, so when your SPA makes requests fromlocalhost:9000to bff.someapplication.somewhere.com, the authentication cookie isn't sent which is why you see your user not being authenticated.The BFF pattern requires same-domain deployment to leverage secure, http only cookies for session management.
You can read more about BFF and hosting models here: https://docs.duendesoftware.com/bff/architecture/ui-hosting/#host-the-ui-separately.
The important bits from the docs is