Skip to content
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

Conversation

cslzchen
Copy link
Contributor

@cslzchen cslzchen commented Aug 18, 2016

    - 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>&nbsp;&nbsp;
<a id="institution-login" href="${osfInstitutionLoginUrl}${not empty param.service ? '&redirect_url=' : ''}${fn:escapeXml(param.service)}">Login&nbsp;Through&nbsp;Your&nbsp;Institution</a>&nbsp;&nbsp;
Copy link
Contributor

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 &nbsp; ever gets out of hand you can also use the css style.

http://www.w3schools.com/cssref/pr_text_white-space.asp

final int code = response.getCode();
final String body = response.getBody();
final long t1 = System.currentTimeMillis();
logger.debug("Request took : " + (t1 - t0) + " ms for : " + dataUrl);
Copy link
Contributor

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 cslzchen changed the title [WIP] [Feature] ORCID Login [#OSF-5162, 6881, 6885] [Feature] ORCID Login [#OSF-5162, 6881, 6885] Aug 24, 2016
@icereval icereval merged commit 40cffe4 into CenterForOpenScience:develop Aug 24, 2016
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