Call web service and generate a token on initial login
I need to create a web service that can be called by other web applications. User credentials will be passed to the web service and I need to create a token that last for a certain amout of time on the intial login. This token will be used for each subsequent call if the token is still valid(time did not expire). Can anyone help or provide an example of how to do this using web services?