-
Notifications
You must be signed in to change notification settings - Fork 22
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
[Feature] ORCID Login [#OSF-5162, 6881, 6885] #22
Merged
icereval
merged 15 commits into
CenterForOpenScience:develop
from
cslzchen:feature/orcid-login-new
Aug 24, 2016
Merged
[Feature] ORCID Login [#OSF-5162, 6881, 6885] #22
icereval
merged 15 commits into
CenterForOpenScience:develop
from
cslzchen:feature/orcid-login-new
Aug 24, 2016
Conversation
This file contains 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
- new spring `remoteAuthenticationManager` contains new bean `loginThroughOrcid` with constructor parameters - new action `exchangeForOAuthAccessToken` which makes a POST request to exchange authorization code for user credentials including name and orcid - new helper `getOrcidLoginUrl` which builds ORCID authorization url
- new action state `orcidLogin` - new transition from `remoteAuthenticate` to `orcidLogin` - the above transition is triggered by `/login?campaign=orcid&code=********`
- refactor helper `getOrcidLoginUrl` into new action `generateOAuthAuthorizationUrl`, which build the orcid auth url with service url stored in `state` parameter - update action `OpenScienceFrameworkPrincipalFromRequestRemoteUserNonInteractiveCredentialsAction` to handle ORCID `authorize` and `exchange` - add new action-state `orcidGenerateAuthorizationUrl`, new end-state `orcidRedirect`; update action-state `remoteAuthenticate`; and rename action-state `orcidLogin` to `orcidExchangeForAccessToken` - update ui, code style and TODO comments
- update `OpenScienceFrameworkCredential` - update `OpenScienceFrameworkAuthenticationHandler` - build credential based on orcid and accept authentication through orcid
- OrcidApi20.java - set correct authorize and exchange uri (public) - OrcidClient.java: - `getProfileUrl`: set correct public api - `sendRequestsForData`: remove access token from header and url to retrieve public profile - ClientAction.java: - need to fix service context here (nothing changed here)
@@ -23,9 +23,9 @@ | |||
<div class="row" style="text-align: center;"> | |||
<hr> | |||
<spring:eval var="osfInstitutionLoginUrl" expression="@casProperties.getProperty('osf.institutionLogin.url')" /> | |||
<a id="institution-login" href="${osfInstitutionLoginUrl}${not empty param.service ? '&redirect_url=' : ''}${fn:escapeXml(param.service)}">Login Through Your Institution</a> | |||
<a id="institution-login" href="${osfInstitutionLoginUrl}${not empty param.service ? '&redirect_url=' : ''}${fn:escapeXml(param.service)}">Login Through Your Institution</a> |
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 is fine but if
ever gets out of hand you can also use the css style.
final int code = response.getCode(); | ||
final String body = response.getBody(); | ||
final long t1 = System.currentTimeMillis(); | ||
logger.debug("Request took : " + (t1 - t0) + " ms for : " + dataUrl); |
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.
looks like some leftover debug/timing code
cslzchen
changed the title
[WIP] [Feature] ORCID Login [#OSF-5162, 6881, 6885]
[Feature] ORCID Login [#OSF-5162, 6881, 6885]
Aug 24, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Tickets
https://openscience.atlassian.net/browse/OSF-6885
https://openscience.atlassian.net/browse/OSF-6881
https://openscience.atlassian.net/browse/OSF-5162
Related OSF PR
CenterForOpenScience/osf.io#6192
Description
Release Updates
cas.properties - oauth client configuration
services/staging.osf.io - released attributes to support oauth client