Generating access token secret for user


To use the Rest API you need to give access token and access_secret token; so far I’ve been able to do what I want with the API but the problem is that I’ve entered a static (generated from from the app) access token + secret access token.
So how is it possible to generate access token and secret_access token for each user who approves to use your app
I found the example bellow authentication with twitter but it gives you access token only.