Oauth not working

This is a preivous Farmier instance.

Never used the api on this instance after the migration.
I did change the redirect URI at the client page to reflect my domain instead of the farmier domain.

Is all this related to keys?

When I view one of the scopes at
/admin/config/people/simple_oauth/oauth2_scope/static/farm_viewer/view I get this errors:

I see some images of the simple auth module have a generate key button. But I don’t have this.

1 Like

You do need to have keys set up in order to use OAuth. Since you are coming off of Farmier, you will need to set those up. The farmOS API module will attempt to auto-generate them when it is first installed, but you are not installing it for the first time, so you will need to set them up manually.

I found this old comment that might help: OAuth keys missing in Docker setup - #2 by mstenta

2 Likes

Hmm… I created the keys in ./farmos-keys folder.
But I can’t I reach them?
Wrong permissions?

 volumes:
      - './farmos-www:/opt/drupal'
      - './farmos-keys:/opt/drupal/keys'

keys folder inside container:

drwxr-xr-x  2 www-data www-data   4096 Jan 24 17:13 keys

-rw------- 1 www-data www-data 1700 Jan 24 17:13 private.key
-rw-rw-r-- 1 www-data www-data  451 Jan 24 17:13 public.key

1 Like

Did you docker composer down and docker compose up after adding that volume?

Yep. I did.
But ah… crap… I can see it now.
The url had changed to the wrong container some time.
Saved all very well now.

My bad.
I usually doublecheck this.

Oh… It works :flushed:

3 Likes