Server side implementation of authenticate_and_authorize with tokens