Skip to content

ORCID authentication - #1184

Merged
fbacall merged 12 commits into
masterfrom
orcid-integration
Dec 5, 2025
Merged

ORCID authentication#1184
fbacall merged 12 commits into
masterfrom
orcid-integration

Conversation

@fbacall

@fbacall fbacall commented Nov 28, 2025

Copy link
Copy Markdown
Member

Summary of changes

  • Adds a flag to Profile to say if an ORCID is authenticated or not.
  • Allows the user's ORCID in their profile to be "authenticated" by authenticating with orcid.org via OAuth2.
  • Display authenticated/unauthenticated ORCIDs differently in the UI.
  • Changes how ORCIDs are stored in the database to be in their "raw" form (no preceding https://orcid.org/).

Motivation and context

#783

plus potential automatic linking of resources to a TeSS profile in the future.

Screenshots

image image

Checklist

  • I have read and followed the CONTRIBUTING guide.
  • I confirm that I have the authority necessary to make this contribution on behalf of its copyright owner and agree
    to license it to the TeSS codebase under the
    BSD license.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread app/helpers/users_helper.rb Outdated
Comment thread app/models/profile.rb
Comment thread test/controllers/orcid_controller_test.rb
Comment thread app/helpers/users_helper.rb Outdated
Comment thread app/controllers/concerns/orcid_authentication.rb Outdated
Comment thread app/controllers/concerns/orcid_authentication.rb Outdated
Comment thread config/routes.rb Outdated
Comment thread db/migrate/20251128160923_update_orcids_in_profiles.rb Outdated
Comment thread db/migrate/20251128160923_update_orcids_in_profiles.rb
Comment thread app/views/users/show.html.erb Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread app/models/profile.rb
Comment thread app/controllers/orcid_controller.rb Outdated
Comment thread app/models/profile.rb
@fbacall
fbacall marked this pull request as ready for review December 3, 2025 12:57
@fbacall
fbacall merged commit 8e11ae8 into master Dec 5, 2025
11 checks passed
@fbacall
fbacall deleted the orcid-integration branch December 5, 2025 15:35
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.

2 participants