fedidcg / FedCM

A privacy preserving identity exchange Web API
https://fedidcg.github.io/FedCM
Other
357 stars 66 forks source link

getUserInfo returns InvalidStateError when ConfigURL is valid? #554

Closed sjud closed 1 month ago

sjud commented 2 months ago

I'm trying to build a test RP/IDP for current chrome canary https://github.com/sjud/fedcm-example-rp I'm running Version 125.0.6402.0 (Official Build) canary (x86_64)

And I am running into an issue where I am using a valid ConfigURL in my getUserInfo call

IdentityProvider.getUserInfo({
            configUrl: "http://127.0.0.1:3000/idp/config",
            clientId: "my_client_id",
        })

I believe it's valid because I have a working navigator.credentials.get() call using it

navigator.credentials.get({
                identity: {
                    context:"continue",
                  providers: [{
                    configURL: "http://127.0.0.1:3000/idp/config",
                    clientId: "my_client_id",
                    nonce: "123",
                  }]
                }
              })

My getUserInfo is being called from http://127.0.0.1:3000,

I get this errror

InvalidStateError : Provider information is incomplete

This is after I've logged into the IDP, returned to the site. It's from an iframe with allow="identity-credentials-get" whose src is "http://127.0.0.1:3000/idp"

I am running the IDP and the RP off of the same origin.

Thanks!

samuelgoto commented 2 months ago

Just so that we know (the next person that runs into this knows), any chance you could report back on this thread what resolved this issue? Was there something in the documentation that maybe was too easily to overlook?

cbiesinger commented 2 months ago

I suspect the cause was that configUrl should be configURL in getUserInfo, like in n.c.get()

It is unfortunate that we did not provide a better error message

cbiesinger commented 1 month ago

Closing on the assumption that my previous comment was the actual issue. We have also improved the error message for this case (in Chrome 125, https://chromium-review.googlesource.com/c/chromium/src/+/5435933)

However, if there is something else that we can do to help here please feel free to reopen.

sjud commented 1 month ago

Hi, Sorry I didn't respond to this. Yes you were right. Thanks for improving the error message. :)