Base solution for your next web application
Open Closed

One time use token #3088


User avatar
0
evannielsen created

I need to implement a one time use token where a user would send me a token as part of the query string and that would allow that request to take place under the context of the user that the token was assigned.

Does anyone know how to accomplish this in an app service? It doesn't seem like you have access to the raw request at that point.


1 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    While this question is not directly related to AspNet Zero and it's just a general web application development topic, it's generally done in two ways: a) An encrypted token which contains user id and operation information. You get this token as parameter, decrypt and perform the operation. b) A random token (which is safer). In that case, you should generate this random token (generall a GUID) and store user/operation information on database. Then find the user/operation from database using the query string token.

    Anyway, as I said it's a general topic, you can even find some articles/samples on the web.