From 61599edc6c61539c1ec38e515ae74b07ca9ca938 Mon Sep 17 00:00:00 2001 From: chaitanyapotti Date: Tue, 24 Nov 2020 22:13:53 +0800 Subject: [PATCH] Fix issues with aggregate login --- .idea/dictionaries/chai.xml | 1 + .../torusresearch/torusdirectandroid/MainActivity.java | 5 +++++ torusdirect/build.gradle | 8 ++++---- .../org/torusresearch/torusdirect/TorusDirectSdk.java | 3 ++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.idea/dictionaries/chai.xml b/.idea/dictionaries/chai.xml index 17553a4..6fe0d51 100644 --- a/.idea/dictionaries/chai.xml +++ b/.idea/dictionaries/chai.xml @@ -2,6 +2,7 @@ discordapp + keccak linkedin mainnet reddit diff --git a/app/src/main/java/org/torusresearch/torusdirectandroid/MainActivity.java b/app/src/main/java/org/torusresearch/torusdirectandroid/MainActivity.java index 7ee738e..53f045e 100644 --- a/app/src/main/java/org/torusresearch/torusdirectandroid/MainActivity.java +++ b/app/src/main/java/org/torusresearch/torusdirectandroid/MainActivity.java @@ -82,10 +82,15 @@ public void launch(View view) { this.selectedLoginVerifier.getVerifier(), this.selectedLoginVerifier.getClientId(), builder.build())).get(); } +// TorusAggregateLoginResponse torusAggregateLoginResponse; +// torusAggregateLoginResponse = this.torusSdk.triggerAggregateLogin(new AggregateLoginParams(AggregateVerifierType.SINGLE_VERIFIER_ID, "google-auth0-gooddollar", new SubVerifierDetails[]{ +// new SubVerifierDetails(LoginType.GOOGLE, "google-shubs", "1015336103925-reqktqs0ns9vfaeh7nbt8mi634u9157k.apps.googleusercontent.com") +// })).get(); // Gson gson = new Gson(); // String json = gson.toJson(torusLoginResponse); String json = torusLoginResponse.getPublicAddress(); +// String json = torusAggregateLoginResponse.getPublicAddress(); Log.d(MainActivity.class.getSimpleName(), json); runOnUiThread(() -> ((TextView) findViewById(R.id.output)).setText(json)); } catch (Exception e) { diff --git a/torusdirect/build.gradle b/torusdirect/build.gradle index d8a03f7..e161c7e 100644 --- a/torusdirect/build.gradle +++ b/torusdirect/build.gradle @@ -11,7 +11,7 @@ android { minSdkVersion 26 targetSdkVersion 30 versionCode 1 - versionName "1.0.14" + versionName "1.0.15" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles 'consumer-rules.pro' @@ -33,10 +33,10 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) api 'androidx.browser:browser:1.2.0' // api 'com.google.androidbrowserhelper:androidbrowserhelper:1.3.2' - implementation 'com.auth0:java-jwt:3.10.3' - implementation 'com.squareup.okhttp3:okhttp:4.8.0' + implementation 'com.auth0:java-jwt:3.11.0' + implementation 'com.squareup.okhttp3:okhttp:4.9.0' implementation 'org.torusresearch:fetch-node-details-java:1.0.7' - implementation 'org.torusresearch:torus-utils-java:1.0.3' + implementation 'org.torusresearch:torus-utils-java:1.0.4' implementation 'com.google.code.gson:gson:2.8.6' //noinspection GradleDependency api 'org.web3j:crypto:4.6.0-android' diff --git a/torusdirect/src/main/java/org/torusresearch/torusdirect/TorusDirectSdk.java b/torusdirect/src/main/java/org/torusresearch/torusdirect/TorusDirectSdk.java index 0b0c647..983797c 100644 --- a/torusdirect/src/main/java/org/torusresearch/torusdirect/TorusDirectSdk.java +++ b/torusdirect/src/main/java/org/torusresearch/torusdirect/TorusDirectSdk.java @@ -109,7 +109,8 @@ public CompletableFuture triggerAggregateLogin(Aggr aggregateVerifierId = userInfo.getVerifierId(); } Collections.sort(aggregateIdTokenSeeds); - String aggregateIdToken = Hash.sha3(String.join(Character.toString((char) 29), aggregateIdTokenSeeds)); + String aggregateTokenString = String.join(Character.toString((char) 29), aggregateIdTokenSeeds); + String aggregateIdToken = Hash.sha3String(aggregateTokenString).substring(2); aggregateVerifierParams.setVerifier_id(aggregateVerifierId); HashMap aggregateVerifierParamsHashMap = new HashMap<>(); aggregateVerifierParamsHashMap.put("verify_params", aggregateVerifierParams.getVerify_params());