There are 2 types of Facebook access tokens:
- Short Access Token (expiry of few hours)
- Long Access Token (expiry of 60 days)
Long access tokens can't be directly generated. They are fetched by exchanging the short access token. This introduces a peculiar problem. Upon container start,
- Depending on the short access token is not a good strategy since it is extremely likely to be expired.
- Depending on the long access token is ideal - but because it is bound to expire too - we need to update it.
Writing a simple lambda function to do the long access token rotation would solve this problem. For AWS Fargate deployments, we can store these secrets in AWS Secrets Manager which supports rotating secrets using a lambda function.
There are 2 types of Facebook access tokens:
Long access tokens can't be directly generated. They are fetched by exchanging the short access token. This introduces a peculiar problem. Upon container start,
Writing a simple lambda function to do the long access token rotation would solve this problem. For AWS Fargate deployments, we can store these secrets in AWS Secrets Manager which supports rotating secrets using a lambda function.