keygen-sh / keygen-api

Keygen is a fair source software licensing and distribution API built with Ruby on Rails. For developers, by developers.
https://keygen.sh
Other
824 stars 53 forks source link

Generate a token always give me 4040 #737

Closed derekhe closed 1 year ago

derekhe commented 1 year ago

HI,

I setup my self-hosted server ref to: https://keygen.sh/docs/self-hosting/ The server is up, and the ping is working. My understand is that I should get a token ( https://keygen.sh/docs/api/tokens/#tokens-generate) to do other tasks but it failed:

curl -X POST https://api.keygen.sh/v1/accounts/<account>/tokens \
  -H 'Accept: application/vnd.api+json' \
  -u "<email>:<password>"

The command always gives me errors. I've replaced the using the account slug, email and password when doing the setup.

{'meta': {'id': 'a4bf1c8c-9371-4dc6-846e-6d8d057d677e'},
 'errors': [{'title': 'Not found',
   'detail': 'The requested endpoint was not found (check your HTTP method and resource path)',
   'code': 'NOT_FOUND'}]}

Any suggestions?

ezekg commented 1 year ago

That example curl request is not for a self-hosted instance of Keygen, but rather to Keygen Cloud (i.e. it's to api.keygen.sh).

What is your KEYGEN_HOST environment variable set to? It should match the domain you're self-hosting Keygen on.

Depending on your TLD for KEYGEN_HOST, you may need to set KEYGEN_DOMAIN and KEYGEN_SUBDOMAIN.

ezekg commented 1 year ago

Closing due to lack of response. Feel free to add additional information and I'll reopen.