Create Consumer

Create OAuth consumer


Generate keys

Generate a pair of keys to encrypt the tokens. And store them outside of your document root (`web` directory) for security.

  1. Visit /admin/config/people/simple_oauth
  2. Click Generate keys to generate encryption keys for tokens
  3. Fill in Directory for the keys.
  4. Click Generate.

You can also use `openssl` to generate keys:

openssl genrsa -out private.key 2048
openssl rsa -in private.key -pubout > public.key

Create Consumer

  1. Visit /admin/config/services/consumer/add
  2. Fill in the following values:
  • Label: `Next.js site`
  • User: `Select the user we created`
  • Secret: `Your secret`
  • Scopes: `Select the role we created`
  1. Click Save

Important: note the client id (uuid) and the secret. These are going to be used as environment variables for the Next.js site.