-
Notifications
You must be signed in to change notification settings - Fork 140
ORCiD authentication #4145
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
Merged
Merged
ORCiD authentication #4145
Changes from 2 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
6757cee
added orcid authentication incl profile creation
bkampe c906861
disabled automatic account and profile creation
bkampe 6c59eae
avoid flexible whitespace matching
bkampe 1db5fc3
corrected lexicographical order for imports
bkampe f4435f7
corrected styles
bkampe e68a15c
removed gson dependency and use jackson instead
bkampe b2ec93e
cleanup - removed unused code
bkampe 3c70030
ORCID spelling correction
bkampe e2731f3
removed hardcoded localhost path
bkampe 11212aa
Update api/src/main/java/org/vivoweb/webapp/controller/freemarker/Orc…
bkampe 6366242
cleanup - removed unused code
bkampe 93b4077
Merge branch 'orcid-auth' of github.com:bkampe/VIVO into orcid-auth
bkampe db3dd25
removed unused templates
bkampe bebbcba
use unknown profile message for non existing account
bkampe c6b2ad5
removed orcid login button
bkampe 3bcb376
use the existing orcid parameters from runtime.properties
bkampe cbac0c3
check for profile whose vivo:orcidId matches the orcidToken.orcid and…
bkampe 5b634e1
added option to enable/disable orcid authentication via runtime.prope…
bkampe 7c19a82
typo correction
bkampe d0c1bcf
typo correction
bkampe a1c51a0
only persons associated with user accounts are returned
bkampe dac458a
check for http and https ORCID URIs
bkampe 1005f61
some code correction and simplification
bkampe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1,123 changes: 1,123 additions & 0 deletions
1,123
api/src/main/java/org/vivoweb/webapp/controller/freemarker/OrcidAuthController.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
webapp/src/main/webapp/templates/freemarker/body/orcidAuth/claimDOIs.ftl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| <style> | ||
|
bkampe marked this conversation as resolved.
Outdated
|
||
| .claim-for { | ||
| float: right; | ||
| border: 2px solid #3e8baa; /* #E0E0E0; */ | ||
| padding: 5px; | ||
| } | ||
| .claim-for h3 { | ||
| text-align: center; | ||
| } | ||
| </style> | ||
| <#if newAccount> | ||
| <h2>Welcome ${profileName}</h2> | ||
| <#else> | ||
| <h2>Welcome back, ${profileName}</h2> | ||
| </#if> | ||
| <br /> | ||
| <#if externalIds??> | ||
| <p>We found works for you to claim. For each work, you will have an opportunity to indicate your role in the work.</p> | ||
| <p><b>There are ${externalCount} work<#if externalCount != 1>s</#if> to claim.</b></p> | ||
| <p>Click the "Claim these works" to claim the works. Click Cancel if you do not wish to claim works at this time.</p> | ||
| <form action="${urls.base}/createAndLink/doi" method="post"> | ||
| <input type="hidden" name="externalIds" value="${externalIds}" /> | ||
| <input type="hidden" name="action" value="findID" /> | ||
| <input type="hidden" name="profileUri" value="${profileUri!}" /> | ||
| <input type="submit" class="submit" value="Claim these works" /> <a href="${profileUrl(profileUri)}">Cancel</a> | ||
| </form> | ||
| <#else> | ||
| <#if newAccount> | ||
| <p>We can automatically populate your account with any public works in your ORCiD profile that have a DOI.</p> | ||
| <p>We did not find any works to import at this time.</p> | ||
| <p>If you have works that you would like to have imported, please ensure that they have DOIs, and are set to public. Then log in again.</p> | ||
| <p>You can also claim additional works by DOI or PubMed ID at any time by using the claim buttons on your profile.</p> | ||
| </#if> | ||
| <a href="${profileUrl(profileUri)}">Go To My Profile</a> | ||
| </#if> | ||
4 changes: 4 additions & 0 deletions
4
webapp/src/main/webapp/templates/freemarker/body/orcidAuth/noProfile.ftl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| <h2>ORCiD Profile is not Public</h2> | ||
|
bkampe marked this conversation as resolved.
Outdated
|
||
| <p>Thank you for your interest in OpenVIVO.</p> | ||
| <p>Unfortunately, your ORCiD profile is not public, so we can not read the necessary details to create an account.</p> | ||
| <p>Please make your ORCiD profile public, and then log in to OpenVIVO again.</p> | ||
4 changes: 4 additions & 0 deletions
4
webapp/src/main/webapp/templates/freemarker/body/orcidAuth/notAuthenticated.ftl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| <h2>Not Authenticated</h2> | ||
| <#if message?has_content> | ||
| <p>${message}</p> | ||
| </#if> |
10 changes: 10 additions & 0 deletions
10
webapp/src/main/webapp/templates/freemarker/body/orcidAuth/usageAgreement.ftl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| <p>You have to accept this agreement to register an account</p> | ||
|
bkampe marked this conversation as resolved.
Outdated
|
||
| <form action="${urls.base}/orcidAuth/callback" method="post"> | ||
| <input type="hidden" name="json_token" value='${json_token}' /> | ||
| <input type="checkbox" name="agreements" id="agreements" style="float: left; margin-right: 10px" required> | ||
| <#assign data_protection_url="${urls.base}/dataprotection" > | ||
| <label for="agreements">${i18n().registration_agreement(data_protection_url)} | ||
| </label> | ||
| <input type="submit" class="submit" value="Register"> | ||
| </form> | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.