You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
When we have spa running under server authorization context (i.e. we have cookies authorization) we no able to run secure API calls on prerendering side.
For angular this is blocked till issue: angular/universal#273 resolved
For react (react-redux template) this not working for both client and server render (isomorphic search not passing cookies), but could be fixed.
To enabling server side cookies processing we need to path the cookie string or object from server request to JS module invoke. Currently we can do this by adding additional arg to method:
public static async Task<RenderToStringResult> RenderToString
This method further pass it throw chosen workflow (specific node services) and prepare context object which be accessible in JS rendered module.
This is quite simple feature (from server side perspective), so i could create it.
For the client side modification (template for ng2 still blocked, react template need some deep refactoring), better to create separate issues.
If I understand correctly, the basic thing missing from NodeServices here is the ability to pass through additional arbitrary information from the asp-prerender-* tag helpers into the JS boot function. If that facility existed, you could pass through whatever authentication information was relevant to your application, which might be:
The authenticated username, if you're using ASP.NET auth
A JWT token or similar, if you're using some external auth mechanism
Some information from the user's Session store, if you have some custom auth system or need to pass through something like "what features this user has paid for" etc.
@SteveSandersonMS not really, it mean that we have no ability to operate with request cookies in prerender process. If you have regular MVC cookies auth, and you try to fetch secure resource it will work on client, but fail on server render. This issues simillar but have really different background. This behaivior should populated by default.
Cookies could contain a lot of useful information that used by client side. Without them server prerender lose a lot of efficient.
JWT token is impossible in server render process (it obvious couse we don't have no connect to any client storage at server).
Sessing and cookies could be passed as asp-prerender-model but is it really best option?
I understand you are looking for specific cookie support, rather than relying on the developer to pass through the information manually. Filed #130 to track that.
Activity
laskoviymishka commentedon May 9, 2016
To enabling server side cookies processing we need to path the cookie string or object from server request to JS module invoke. Currently we can do this by adding additional arg to method:
This method further pass it throw chosen workflow (specific node services) and prepare context object which be accessible in JS rendered module.
This is quite simple feature (from server side perspective), so i could create it.
For the client side modification (template for ng2 still blocked, react template need some deep refactoring), better to create separate issues.
feat(prerender): ability to push payload and model to boot func
SteveSandersonMS commentedon Jun 14, 2016
If I understand correctly, the basic thing missing from NodeServices here is the ability to pass through additional arbitrary information from the
asp-prerender-*tag helpers into the JS boot function. If that facility existed, you could pass through whatever authentication information was relevant to your application, which might be:Sessionstore, if you have some custom auth system or need to pass through something like "what features this user has paid for" etc.Do you agree?
Closing this in favour of the more general #107
laskoviymishka commentedon Jun 14, 2016
@SteveSandersonMS not really, it mean that we have no ability to operate with request cookies in prerender process. If you have regular MVC cookies auth, and you try to fetch secure resource it will work on client, but fail on server render. This issues simillar but have really different background. This behaivior should populated by default.
Cookies could contain a lot of useful information that used by client side. Without them server prerender lose a lot of efficient.
laskoviymishka commentedon Jun 14, 2016
JWT token is impossible in server render process (it obvious couse we don't have no connect to any client storage at server).
Sessing and cookies could be passed as
asp-prerender-modelbut is it really best option?SteveSandersonMS commentedon Jun 14, 2016
I understand you are looking for specific cookie support, rather than relying on the developer to pass through the information manually. Filed #130 to track that.
jeinz11 commentedon May 28, 2017
I need this feature badly because im using mvc cookie authentication....
please help
jeinz11 commentedon May 28, 2017
Cookie support please
jeinz11 commentedon May 29, 2017
@laskoviymishka hi can i use this right now?
and pass args with cookies please help