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

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

      In case Client Credentials grant is enabled com.liferay.oauth2.provider.rest.internal.endpoint.access.token.grant.handler.LiferayClientCredentialsAccessTokenGrantHandler
      publishes org.apache.cxf.rs.security.oauth2.grants.clientcred.ClientCredentialsGrantHandler

      Developer Flow Usage

      Access token endpoint details:

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

      This flow doesn't support refresh token.

      The remote client application acts on behalf of the OAuth2 Application creator / owner.

      Example

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

      • Client ID: clientCredentialsTest
      • Client secret: secret-d0b1536a-cf81-2737-7ba0-2089b71f063
      • Allowed Grants:
        • Client Credentials

      Remote client request:

      curl 'http://localhost:8080/o/oauth2/token' --data 'grant_type=client_credentials&client_id=clientCredentialsTest&client_secret=secret-d0b1536a-cf81-2737-7ba0-2089b71f063'

      Server returns JSON with the tokens content:

      {"access_token":"88a6ab91e3c1d0555e815cb77826e477eaa8b71ad3a6a61e72eb364f72ec9e19","token_type":"Bearer","expires_in":600}

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Packages

                  Version Package