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

Write a lambda function to rotate Facebook Access Token #1

Open
ghostwriternr opened this issue Sep 27, 2020 · 2 comments
Open

Write a lambda function to rotate Facebook Access Token #1

ghostwriternr opened this issue Sep 27, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request Hacktoberfest This issue counts towards Hacktoberfest contributions help wanted Extra attention is needed

Comments

@ghostwriternr
Copy link
Member

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.

@ghostwriternr
Copy link
Member Author

We will be using https://github.com/lttkgp/graphapi-key-rotation to implement this. Since the rotation function is independent of this project, we can implement it in any language. AWS provides templates in Python for this specific task, so Python is a good choice.
Template reference: lambda_function.py

@ghostwriternr ghostwriternr transferred this issue from lttkgp/R2-D2 Oct 2, 2020
@ghostwriternr ghostwriternr added Hacktoberfest This issue counts towards Hacktoberfest contributions enhancement New feature or request help wanted Extra attention is needed labels Oct 2, 2020
@ghostwriternr ghostwriternr self-assigned this Dec 11, 2020
@mukul-mehta mukul-mehta self-assigned this Dec 25, 2020
@2000yeshu
Copy link

Hey! I can take this up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Hacktoberfest This issue counts towards Hacktoberfest contributions help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants