diff --git a/pages/openid.js b/pages/openid.js index b82c736..85ce810 100644 --- a/pages/openid.js +++ b/pages/openid.js @@ -236,6 +236,7 @@ function OID4VPProofRequest({ title, desc, proofRequestSetupObject }) { export default function Home() { const [ebsiURLS, setEBSIUrls] = useState(); const [credentialOffer, setCredentialOffer] = useState(); + const [credentialOfferNoAuth, setCredentialOfferNoAuth] = useState(); async function createCredentialOffer() { const { data: credentialOffer } = await postRequestLocal('create-credential-offer', { @@ -253,6 +254,20 @@ export default function Home() { setCredentialOffer(credentialOffer); } + async function createCredentialOfferNoAuth() { + const { data: credentialOffer } = await postRequestLocal('create-credential-offer', { + credentialOptions: { + credential: { + ...credential, + issuer: process.env.NEXT_PUBLIC_QUOTIENT_ISSUER_ID, + }, + }, + singleUse: true, + }); + + setCredentialOfferNoAuth(credentialOffer); + } + async function generateEBSIUrls() { const { data: proofRequest } = await postRequestLocal('create-proof-request-object', { did: process.env.NEXT_PUBLIC_QUOTIENT_ISSUER_ID, @@ -265,8 +280,9 @@ export default function Home() { } useEffect(() => { - if (!credentialOffer) { + if (!credentialOffer && !credentialOfferNoAuth) { createCredentialOffer(); + createCredentialOfferNoAuth(); } }, []); @@ -306,6 +322,28 @@ export default function Home() { +
OID4VCI (no auth)
++ Scan this QR code to initiate an OID4VCI import flow and instantly get a + credential. +
+