Closed WilliamDoman closed 10 years ago
You mean like this: https://github.com/thinktecture/Thinktecture.AuthorizationServer/issues/118
Of course you can transmit the token to the JavaScript - if you are OK that this "lives" on the client - e.g. in terms of lifetime.
I'm sorry, I need a tiny bit more detail. I don't really understand the mechanics or the consequences of these choices.
From #118
1) The code flow access token could be shared with the JS. This sort of breaks the higher level of security that code flow is meant to ensure, though.
2) The implicit flow access token in the JS could be shared with the server.
3) Look into the assertion flow, except this involves more round trips to the AS (which is what you wanted to avoid, I think).
4) Do what you originally said -- obtain two access tokens via the two flows.
1) Sure -- you'd get it back to the JS somehow. 2) Again, if the server has it then any HTML response to the browser would need to carry the token. 3) I guess assertion is too much work for most people. Doing the token sharing server-to-client might just be easiest for most people. 4) Yep, doing two formal requests with the two diff flows might also work (for your requirements, I mean).
I'll play with the different scenarios.
Thanks
I'm still trying to figure out the flows but is it possible to send down the bearer token from the server side, aquired by resource owner password flow, to be used by javascript ajax requests from the client?
To be a little more clear, I have a MVC site that has server side controller/view pages and in many parts, heavy javascript/ajax against webapi2 functionality. (No control over this) If they log in and get a bearer token in the server side, what would be the best practice for the ajax getting a bearer token? I don't want to collect username/password in the javascript and I want the user experience to seem seamless and looking at the ImplicitFlow javascript example, it has redirects to get the token. I'm not sure how that would work with many pages needing the token.
Any advice?
Thanks