Skip to content

Commit

Permalink
Merge pull request #38 from 0xPolygonID/universal-links
Browse files Browse the repository at this point in the history
Universal link Integration and UI changes
  • Loading branch information
0xpulkit authored Oct 24, 2024
2 parents ba35282 + 73c39e2 commit 8520467
Show file tree
Hide file tree
Showing 8 changed files with 690 additions and 297 deletions.
3 changes: 0 additions & 3 deletions verifier-integration/go/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ func GetAuthRequest(w http.ResponseWriter, r *http.Request) {
// Generate request for basic authentication
var request protocol.AuthorizationRequestMessage = auth.CreateAuthorizationRequest("test flow", Audience, uri)

request.ID = "7f38a193-0918-4a48-9fac-36adfdb8b542"
request.ThreadID = "7f38a193-0918-4a48-9fac-36adfdb8b542"

// Add request for a specific proof
var mtpProofRequest protocol.ZeroKnowledgeProofRequest
mtpProofRequest.ID = 1
Expand Down
28 changes: 15 additions & 13 deletions verifier-integration/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ const path = require("path");
const express = require("express");
const { auth, resolver, protocol } = require("@iden3/js-iden3-auth");
const getRawBody = require("raw-body");

const cors = require('cors');
const app = express();
const port = 8080;

app.use(express.static("../static"));
app.use(cors());

app.get("/api/sign-in", (req, res) => {
console.log("get Auth Request");
Expand Down Expand Up @@ -39,8 +40,6 @@ async function getAuthRequest(req, res) {
// Generate request for basic authentication
const request = auth.createAuthorizationRequest("test flow", audience, uri);

request.id = "7f38a193-0918-4a48-9fac-36adfdb8b542";
request.thid = "7f38a193-0918-4a48-9fac-36adfdb8b542";

// Add request for a specific proof
const proofRequest = {
Expand Down Expand Up @@ -75,20 +74,23 @@ async function callback(req, res) {
// get JWZ token params from the post request
const raw = await getRawBody(req);
const tokenStr = raw.toString().trim();
console.log(tokenStr);

const ethURL = "<AMOY_URL>";
const contractAddress = "0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124";
const keyDIR = "../keys";

const ethStateResolver = new resolver.EthStateResolver(
ethURL,
contractAddress
);

const resolvers = {
["polygon:amoy"]: ethStateResolver,
};
["polygon:amoy"]: new resolver.EthStateResolver(
"<Polygon_Amoy_RPC_URL>",
"0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124"
),
["privado:main"]: new resolver.EthStateResolver(
"https://rpc-mainnet.privado.id",
"0x975556428F077dB5877Ea2474D783D6C69233742"
),
["privado:test"]: new resolver.EthStateResolver(
"https://rpc-testnet.privado.id/",
"0x975556428F077dB5877Ea2474D783D6C69233742"
)
};

// fetch authRequest from sessionID
const authRequest = requestMap.get(`${sessionId}`);
Expand Down
Loading

0 comments on commit 8520467

Please sign in to comment.