Uploaded image for project: 'Realm Core'
  1. Realm Core
  2. RCORE-1273

Incorrect user provider being recorded for server api key users

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • Q2-24FY
    • Affects Version/s: None
    • Component/s: None

      When we persist the user in the metadata Realm, we use the string representation of the provider but we have the same representations for apiKey and serverApiKey:

      https://github.com/realm/realm-core/blob/7b087008a19773f1bb92324d410f9e70db17fca9/src/realm/object-store/sync/app_credentials.cpp#L33-L34

      Is this intentional? This has the unpleasant side effect that:

      enum_from_provider_type(provider_type_from_enum(AuthProvider::SERVER_API_KEY)) != AuthProvider::SERVER_API_KEY;
      

      And if you log in a user with a server api key credential, their provider will instead be API_KEY.

            Assignee:
            james.stone@mongodb.com James Stone
            Reporter:
            nikola.irinchev@mongodb.com Nikola Irinchev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: