adding configuration and check for valid token