Skip to content

Write a lambda function to rotate Facebook Access Token #1

Description

@ghostwriternr

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

HacktoberfestThis issue counts towards Hacktoberfest contributionsenhancementNew feature or requesthelp wantedExtra attention is needed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions