Details

    • Type: Sub-Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Completed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Developer Implementation Details

      In case Refresh Token grant is enabled com.liferay.oauth2.provider.rest.internal.endpoint.access.token.grant.handler.LiferayRefreshTokenAccessTokenGrantHandler
      publishes org.apache.cxf.rs.security.oauth2.grants.refresh.RefreshTokenGrantHandler

      The original implementation is using CXF OAuth2 RefreshTokenGrantHandler, please see http://cxf.apache.org/docs/jax-rs-oauth2.html

      Developer - Endpoint Usage

      Refresh token endpoint details:

      • HTTP Method: POST
      • URL: /o/oauth2/token
      • Parameters:
        • grant_type must be set to refresh_token
        • client_id ... required parameter, corresponds to OAuth2 Application clientId
        • client_secret ... corresponds to OAuth2 Application clientSecret, required when set
        • refresh_token ... required parameter, the refresh token content
      • Returns new access token and other attributes

      Example

      Let's suppose there is "Test OAuth2 Application" created in portal with

      • Client ID: refreshTokenTest
      • Client secret: secret-e2fa3e32-cb9d-21e8-8c5c-d5df9292c162
      • Allowed Grants:
        • Resource Owner Password Credentials
        • Refresh Token

      Obtain refresh token (only to demonstrate the connection between)

      curl 'http://localhost:8080/o/oauth2/token' --data 'grant_type=refresh_token&client_id=refreshTokenTest&client_secret=secret-e2fa3e32-cb9d-21e8-8c5c-d5df9292c162&refresh_token=e3933d5558a0707ce5424491e5225f3569238e71bbf2498df528321d7d601c5'
      

      Server returns JSON with the tokens content:

      {"access_token":"dd63ef02ceb7fe0e1fd204483bf75e09468801a4ef5c855d58f704e18c25c8b","token_type":"Bearer","expires_in":600,"refresh_token":"2d2b7be1abce395c3615b75b22e0d82894b636d6682d13096435ab0e6bb9d3d"}
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Packages

                  Version Package