code: public Credential createAndStoreCredential(ImplicitResponseUrl implicitResponse, String userId)
              throws IOException {
          Credential credential = newCredential(userId)
                  .setAccessToken(implicitResponse.getAccessToken())
                  .setExpiresInSeconds(implicitResponse.getExpiresInSeconds());
          CredentialStore credentialStore = getCredentialStore();
          if (credentialStore != null) {
              credentialStore.store(userId, credential);
          }
          if (credentialCreatedListener != null) {
              credentialCreatedListener.onCredentialCreated(credential, implicitResponse);
          }
          return credential;
      }
docs: Creates a new credential for the given user ID based on the given token
  response and store in the credential store.
  
  @param response implicit authorization token response
  @param userId user ID or {@code null} if not using a persisted credential
  store
  @return newly created credential
  @throws IOException