Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Draft
mipyykko wants to merge 5 commits into
mastertestmycode/tmc-server:masterfrom
refactor-moocfi-tokenstestmycode/tmc-server:refactor-moocfi-tokensCopy head branch name to clipboard
Draft

Refactor: can use MOOC.fi tokens to authenticate#541
mipyykko wants to merge 5 commits into
mastertestmycode/tmc-server:masterfrom
refactor-moocfi-tokenstestmycode/tmc-server:refactor-moocfi-tokensCopy head branch name to clipboard

Conversation

@mipyykko
Copy link
Copy Markdown
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

@qlty-cloud-legacy
Copy link
Copy Markdown

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.