-
Notifications
You must be signed in to change notification settings - Fork 487
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
Public ORCID login is available. #7025
Changes from 5 commits
c10b516
55c2c89
8da201b
9d7c843
0bcd871
8063067
5a98e64
9475838
d588210
298bfab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"id":"orcid-public", | ||
"factoryAlias":"oauth2", | ||
"title":"ORCID", | ||
"subtitle":"", | ||
"factoryData":"type: orcid | userEndpoint: https://pub.orcid.org/v2.1/{ORCID}/person | clientId: FIXME | clientSecret: FIXME", | ||
"enabled":true | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,12 @@ public class OrcidOAuth2AP extends AbstractOAuth2AuthenticationProvider { | |
public static final String PROVIDER_ID_SANDBOX = "orcid-sandbox"; | ||
|
||
public OrcidOAuth2AP(String clientId, String clientSecret, String userEndpoint) { | ||
scope = Arrays.asList("/read-limited"); | ||
|
||
String s = null; | ||
if(userEndpoint != null){ | ||
s = userEndpoint.startsWith("https://pub") ? "/authenticate" : "/read-limited"; | ||
} | ||
scope = Arrays.asList(s); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One could argue that this can be done more compact with only one E. g. like if(userEndpoint != null && userEndpoint.startsWith("https://pub")) {
this.scope = Arrays.asList("/authenticate");
} else {
this.scope = Arrays.asList("/read-limited");
} Or you leave it to the code optimizer of the JVM... 😉 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm fine with letting the JVM optimize it. 😄 |
||
this.clientId = clientId; | ||
this.clientSecret = clientSecret; | ||
this.baseUserEndpoint = userEndpoint; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This done so I'm moving this to code review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. I got the longer link with the "-0" at the end from https://orcid.org/organizations/integrators but I do think the shorter link looks nicer (and goes to the same place) so it would be a good change. @felker13 I don't have access to accept this change.