Skip to content

Commit 54bfb9b

Browse files
committed
take IdpConfig id as input
1 parent cc4957d commit 54bfb9b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/auth/demo/public/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,7 @@
854854
<div class="tab-pane" id="tab-byo-ciam-content">
855855
<h2>Sign in with your CIAM token</h2>
856856
<div id="firebase-token-status">No CIAM token found. User not logged in.</div>
857+
<input type="text" id="idp-config-id" class="form-control" placeholder="IDP Config ID" />
857858
<input type="text" id="byo-ciam-token"
858859
class="form-control" placeholder="Enter CIAM token" />
859860
<button class="btn btn-block btn-primary"

packages/auth/demo/src/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,10 +1615,10 @@ function onFinalizeSignInWithTotpMultiFactor(event) {
16151615
}, onAuthError);
16161616
}
16171617

1618-
async function exchangeCIAMToken(token) {
1618+
async function exchangeCIAMToken(idpConfigId, token) {
16191619
const firebaseToken = await exchangeToken(
16201620
regionalAuth,
1621-
(idpConfigId = 'Bar-e2e-idpconfig-002'),
1621+
idpConfigId,
16221622
token
16231623
);
16241624
return firebaseToken;
@@ -1627,11 +1627,12 @@ async function exchangeCIAMToken(token) {
16271627
function onExchangeToken(event) {
16281628
event.preventDefault();
16291629
const byoCiamInput = document.getElementById('byo-ciam-token');
1630+
const idpConfigId = document.getElementById('idp-config-id');
16301631
const firebaseTokenStatus = document.getElementById('firebase-token-status');
16311632

16321633
firebaseTokenStatus.textContent = 'Exchanging token...';
16331634

1634-
exchangeCIAMToken(byoCiamInput.value)
1635+
exchangeCIAMToken(idpConfigId.value, byoCiamInput.value)
16351636
.then(response => {
16361637
firebaseTokenStatus.textContent = '✅ Firebase token is set: ' + response;
16371638
console.log('Token:', response);

0 commit comments

Comments
 (0)