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

Refactor: can use MOOC.fi tokens to authenticate #541

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

mipyykko
Copy link
Collaborator

@mipyykko mipyykko commented Sep 30, 2021

  • at first, tries the token as TMC token
    • if successful, then it is a TMC token and business as usual
    • if not, we contact MOOC.fi validate endpoint to see if it's a user there
      • if we have successful validation, we receive the MOOC.fi user and try to look for the user by id in TMC
        • if successful, we are validated
        • if not successful, we try to look for the user by email
          • if successful, we contact MOOC.fi /api/user endpoint to update the user upstream_id (ie. TMC id) there
          • if not successful, we create a new TMC user with the data, and update the user upstream_id in MOOC.fi

Relies on the /auth/validate POST and /api/user PATCH endpoints to be there in MOOC.fi, which they currently are not in the master branch.
Needs two new envs: moocfi_update_secret is the secret token used to update the user in MOOC.fi; base_url_for_moocfi is the backend URL ie. https://www.mooc.fi

@codeclimate
Copy link

codeclimate bot commented Sep 30, 2021

Analysis results are not available for those commits

View more on Code Climate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant