SAML Authentication Error – Why is the user authenticated per Azure AD User Logs but Firebase SAML not returning user credentials?

I am using Firebase SAML for my application with base authentication services from Azure AD which contains my organisations users details. I am also using AWS Cognito for providing the SAML as this app will be served through AWS in the end. Below is my code for Index.js where I have imported all firebase resource and configured the code for signing in with SAML:

// SAML Authentication Attempt

//Setting session persistence
setPersistence(auth, browserSessionPersistence)
  .then(() => {
    console.log("Session persistence set to browserSessionPersistence");
  })
  .catch((error) => {
    // Handle Errors here.
    console.error("Error setting persistence", error);
    // Fallback to inMemoryPersistence if browserSessionPersistence fails
    setPersistence(auth, inMemoryPersistence)
      .then(() => {
        console.log("Fallback to inMemoryPersistence");
      })
      .catch((error) => {
        console.error("Error setting inMemory Persistence", error)
      })
  })


// SAML
function ssoSignIn() {
  const provider = new SAMLAuthProvider('saml.saml-aws-iam');
  signInWithRedirect(auth, provider)
    .catch((error) => {
      console.error("Error during signInWithRedirect:", error)
    })
 };

document.getElementById("ssoButton").addEventListener("click", (event) => {
  event.preventDefault(); //Prevent Form Submission
  ssoSignIn();
});


// Loading DOM before attaching event listener
document.addEventListener('DOMContentLoaded', () => {
  const ssoButton = document.getElementById("ssoButton");
  if (ssoButton) {
    ssoButton.addEventListener('click', (event) => {
      event.preventDefault();
      ssoSignIn();
    })
  } else {
    console.error("ssoButton not found in the DOM");
  }

  // Check for redirect result after redirecting back from the SAML Provider
  getRedirectResult(auth)
    .then((result) => {
      if (result && result.user) {
        console.log("User signed in with SSO:", result.user);
        // Redirect
        window.location.href = "dashboard.html";
      } else {
        console.log("No user found after redirect. Result:", result);
      }
    })
    .catch((error) => {
      console.error("Error during getRedirectResult:", error);
    })

})

onAuthStateChanged(auth, (user) => {
  if (user) {
    console.log("User is signed in:", user);
    window.location.href = "dashboard.html";
  } else {
    console.log("No user is signed in.")
  }
})

Based on the code, I expect the user to be redirect to ‘Dashboard.html’ or even for one of the console.log to return user’s details. Instead, I am receiving the following error:

[Error] Error during getRedirectResult: – FirebaseError: Firebase: All <AudienceRestriction>s should contain the SAML RP entity ID: ' urn:amazon:cognito:sp:[MY-USER-POOL-ID]'. (auth/invalid-credential).
FirebaseError: Firebase: All <AudienceRestriction>s should contain the SAML RP entity ID: ' urn:amazon:cognito:sp:eu-west-2_cD0DvWqD2'. (auth/invalid-credential).
    (anonymous function) (index.js:126)

I cannot seem to find the answer to this in any existing forum or through documents, given all redirects are working and that the user log is showing that a user has been logged is confusing as to why this is not working.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật