ORCID authentication - #1184
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds ORCID authentication via OAuth2, allowing users to authenticate their ORCID identifiers through orcid.org. The main changes include adding an orcid_authenticated boolean flag to profiles, modifying ORCID storage to use raw identifiers (without the URL prefix), implementing OAuth2 authentication flow, and updating the UI to visually distinguish authenticated vs unauthenticated ORCIDs.
- Adds OAuth2 authentication flow for ORCID verification via a new concern module
- Changes ORCID database storage from full URL to raw identifier format with migration
- Implements visual differentiation between authenticated and unauthenticated ORCIDs using different SVG icons
Reviewed changes
Copilot reviewed 24 out of 26 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| db/migrate/20251013115523_add_orcid_authenticated_to_profiles.rb | Adds boolean flag to track ORCID authentication status |
| db/migrate/20251128160923_update_orcids_in_profiles.rb | Migrates existing ORCIDs from URL format to raw identifier format |
| app/models/profile.rb | Implements authenticate_orcid method and updates ORCID normalization logic |
| app/controllers/concerns/orcid_authentication.rb | New concern implementing OAuth2 authentication flow for ORCID |
| app/controllers/users_controller.rb | Includes OrcidAuthentication concern |
| app/helpers/users_helper.rb | Adds helper method to render ORCID links with appropriate icons |
| app/views/users/show.html.erb | Updates user profile view to show authentication button and use new helper |
| app/views/trainers/show.html.erb | Updates trainer view to use new orcid_link helper |
| app/views/trainers/partials/_trainer_schemaorg.html.erb | Updates schema.org metadata to use orcid_url method |
| config/routes.rb | Adds routes for ORCID authentication and callback |
| config/locales/en.yml | Adds localization strings for ORCID authentication messages |
| config/secrets.example.yml | Documents required ORCID configuration keys |
| test/config/test_secrets.yml | Adds test ORCID credentials |
| test/fixtures/profiles.yml | Updates fixtures to use raw ORCID identifiers and add authentication flags |
| test/models/profile_test.rb | Adds tests for ORCID authentication functionality |
| test/models/user_test.rb | Updates test to use new orcid_url method |
| test/controllers/users_controller_test.rb | Adds comprehensive tests for ORCID OAuth flow |
| test/controllers/orcid_controller_test.rb | Creates empty test file for future ORCID controller tests |
| test/helpers/users_helper_test.rb | Adds tests for orcid_link helper method |
| test/integration/tracking_test.rb | Updates test to use orcid_url method |
| test/vcr_cassettes/orcid/*.yml | Adds VCR cassettes for ORCID OAuth responses |
| app/assets/images/ORCID-iD_icon_vector.svg | Adds authenticated ORCID icon |
| app/assets/images/ORCID-iD_icon_unauth_vector.svg | Adds unauthenticated ORCID icon |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 25 out of 28 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
* Change how ORCIDs are stored in DB (`0000-`...)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Add error handling
instead of throwing error
bf6f840 to
fdbcf98
Compare
Summary of changes
Profileto say if an ORCID is authenticated or not.https://orcid.org/).Motivation and context
#783
plus potential automatic linking of resources to a TeSS profile in the future.
Screenshots
Checklist
to license it to the TeSS codebase under the
BSD license.