<script>
  navigator.credentials.get({ 'federated': { 'providers': ['https://example.com' ] } })
    .then(c => {
      window.parent.postMessage({
        "status": "resolved",
        "credential": c,
        "exception": null
      }, "*");
    })
    .catch(omg => {
      window.parent.postMessage({
        "status": "rejected",
        "credential": null,
        "exception": omg.name
      }, "*");
    });
</script>
