Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

401 Unauthorized Error when Configuring Scheduler for /wakeup API Endpoint #1

Open
WildfootW opened this issue Jan 9, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@WildfootW
Copy link

Description

I am encountering a 401 Unauthorized error when trying to configure the scheduler (Cron-job) to invoke the /wakeup API endpoint, as per the last instruction in the deployment guide.

Steps to Reproduce

  1. Modified the render.yaml file as per the deployment instructions.
  2. Successfully created a new instance on Render's blueprint using the modified render.yaml.
  3. Received the service URL and appended /callback to construct the webhook URL.
  4. Pasted the webhook URL into the LINE Webhook URL section on LINE Developers.
  5. Attempted to configure the scheduler to invoke the /wakeup API endpoint.

Expected Behavior

The scheduler should successfully invoke the /wakeup API endpoint without authorization issues.

Actual Behavior

Received a 401 Unauthorized error when the scheduler tried to access the /wakeup API endpoint.

Possible Causes/Suggestions

  • Is there a specific format or additional requirements for the API_ACCESS_TOKEN?
@yujunkuo
Copy link
Owner

yujunkuo commented Jan 10, 2024

Hi @WildfootW ,

To resolve the authorization issue, please follow the steps below:

1. Configure the Environment Variable on Render Service:

  • Add a new environment variable named API_ACCESS_TOKEN to your Render service.
  • The value of this environment variable can be any string, for example, abc123.

2. Set the Header in Scheduler's Request:

  • Add a new header named API-Access-Token to your scheduler's request.
  • Set the value of this header to match the one used in the API_ACCESS_TOKEN environment variable, in this case, abc123.

By implementing these changes, the scheduler should be able to successfully invoke the /wakeup API endpoint without encountering authorization issues.

I apologize for the oversight in providing these instructions initially. If you have any further questions or encounter any issues, please feel free to reach out. Thank you for bringing this to my attention.

@yujunkuo yujunkuo added the documentation Improvements or additions to documentation label Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants