Uploaded image for project: 'PUBLIC - OAuth2'
  1. PUBLIC - OAuth2
  2. OAUTH2-200

Unable to use Access Token with no scopes

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: No Longer Reproducible
    • Affects Version/s: Master, 1.0-portal_7.1.0
    • Fix Version/s: Master, 1.1-marketplace_7.1.0
    • Component/s: None
    • Labels:
      None
    • Fix Priority:
      3

      Description

      Steps to reproduce:

      1. Create OAuth2 Application 
        1. clientId: 12345
        2. clientSecret: 12345
        3. Allow Client Credentials Grant
        4. Allow Token Introspection
      2. Get access token
        curl 'http://localhost:8080/o/oauth2/token' --data 'grant_type=client_credentials&client_id=12345&client_secret=12345'
        
        
        
        {"access_token":"a7785f516df0b72bda39a047bfdb952c1e325482a6176372669a2e7380c54e","token_type":"Bearer","expires_in":600}
      1. Introspect the token
        curl http://localhost:8080/o/oauth2/introspect --data "client_id=12345&client_secret=12345&token=a7785f516df0b72bda39a047bfdb952c1e325482a6176372669a2e7380c54e

      Expected result: No error in logs, call returns a JSON with token details

      Actual result: No JSON returned, error in logs

      Caused by: com.liferay.oauth2.provider.exception.NoSuchOAuth2ApplicationScopeAliasesException: No OAuth2ApplicationScopeAliases exists with the primary key 0
      at com.liferay.oauth2.provider.service.persistence.impl.OAuth2ApplicationScopeAliasesPersistenceImpl.findByPrimaryKey(OAuth2ApplicationScopeAliasesPersistenceImpl.java:2080)
      at com.liferay.oauth2.provider.service.persistence.impl.OAuth2ApplicationScopeAliasesPersistenceImpl.findByPrimaryKey(OAuth2ApplicationScopeAliasesPersistenceImpl.java:2098)
      at com.liferay.oauth2.provider.service.base.OAuth2ApplicationScopeAliasesLocalServiceBaseImpl.getOAuth2ApplicationScopeAliases(OAuth2ApplicationScopeAliasesLocalServiceBaseImpl.java:232)
      at sun.reflect.GeneratedMethodAccessor1000.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:158)
      at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:54)
      at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:58)
      at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:135)
      at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:135)
      at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:145)
      at com.sun.proxy.$Proxy598.getOAuth2ApplicationScopeAliases(Unknown Source)
      at com.liferay.oauth2.provider.rest.internal.endpoint.liferay.LiferayOAuthDataProvider.populateAccessToken(LiferayOAuthDataProvider.java:763)
      at com.liferay.oauth2.provider.rest.internal.endpoint.liferay.LiferayOAuthDataProvider.getAccessToken(LiferayOAuthDataProvider.java:276)
      
      

       

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Packages

                Version Package
                Master
                1.1-marketplace_7.1.0