[REQUIRED] Step 2: Describe your environment
- Library version: 5.6.0
- Firebase Product: auth
[REQUIRED] Step 3: Describe the problem
I just upgraded to 5.6.0 version to try custom claims and now I can't get user because I get NoSuchMethodError
Exception in thread "firebase-default-0" java.lang.NoSuchMethodError: org.json.JSONObject.toMap()Ljava/util/Map;
at com.google.firebase.auth.UserRecord.<init>(UserRecord.java:85)
at com.google.firebase.auth.FirebaseUserManager.getUserById(FirebaseUserManager.java:112)
at com.google.firebase.auth.FirebaseAuth$3.call(FirebaseAuth.java:266)
at com.google.firebase.auth.FirebaseAuth$3.call(FirebaseAuth.java:263)
at com.google.firebase.tasks.Tasks$1.run(Tasks.java:82)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Steps to reproduce:
So what I did.
I wanted to keep previous claims so I created copy of map and add new key-val.
@Override
public void addUserCustomClaims(final String userId, String key, String val) {
final UserRecord user = getUser(userId);
final Map<String, Object> customClaims = new HashMap<>(user.getCustomClaims());
customClaims.put(key, val);
final Void aVoid = Single.fromFuture(
firebaseAuth.setCustomUserClaimsAsync(userId, customClaims))
.blockingGet();
}
It was inserted as I see but now I can't get user because it's throwing exception.
With breakpoint set to
|
Map<String, Object> parsed = new JSONObject(customClaims).toMap(); |
I see values
customClaims={"u_type":"USER"}
this.customClaims=null
[REQUIRED] Step 2: Describe your environment
[REQUIRED] Step 3: Describe the problem
I just upgraded to 5.6.0 version to try custom claims and now I can't get user because I get NoSuchMethodError
Steps to reproduce:
So what I did.
I wanted to keep previous claims so I created copy of map and add new key-val.
It was inserted as I see but now I can't get user because it's throwing exception.
With breakpoint set to
firebase-admin-java/src/main/java/com/google/firebase/auth/UserRecord.java
Line 85 in 82510ac
I see values