Token based authentication framework