Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-16597

Fix NPE in OAuth2TokenStore load method

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 7.1
    • Fix Version/s: 7.1
    • Component/s: OAuth

      Description

          @Override
          public boolean load(String userName, Credential credential) {
              try {
      
                  NuxeoOAuth2Token token = getToken(serviceName, userName);
      
                  credential.setAccessToken(token.getAccessToken());
                  credential.setRefreshToken(token.getRefreshToken());
                  credential.setExpirationTimeMilliseconds(token.getExpirationTimeMilliseconds());
                  return true;
              } catch (ClientException e) {
                  log.error("Error during token loading", e);
                  return false;
              }
          }
      

      getToken may return null.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: