Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am creating the web service authentication. When the user login with user name and password. Web server will give the token to the client to request the web service with that token. I would like to define the token with that format (randomcode+UserID+dateformat(yyyy-mm-dd)+randomcode). Can you tell me how to define that format with example. Following is my code for token.
C#
string token = Guid.NewGuid().ToString();

HttpRuntime.Cache.Add(token, Username, null,

System.Web.Caching.Cache.NoAbsoluteExpiration,

TimeSpan.FromMinutes(60),

System.Web.Caching.CacheItemPriority.NotRemovable,

null);

Best Regards,
Wai Mar Khaing
Posted
Updated 8-Sep-11 21:59pm
v2

1 solution

Please have a look on that. It gives you the total solution

Web Service Authentication[^]
 
Share this answer
 
Comments
Md. Rashim Uddin 10-Sep-11 16:27pm    
Did u check it?? It is very helpful.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900