How to do api_token auth alongside with other auth strategy?

I think token resource should be involved, but topics/tokens does not contains much info.

I guess retrieve_from_bearer is relevant, but how can I generate and give api token to user who is authenticated with password/oauth2?

Just found this.

The solution was to ensure that tokens were enabled with

tokens do
  enabled? true
end