logto-io / logto

🧑‍🚀 The better identity infrastructure for developers and the open-source alternative to Auth0.
https://logto.io
Mozilla Public License 2.0
8.62k stars 437 forks source link

feature request: Support parsing 'expires_in' in token response as both number and string #5497

Open magohl opened 7 months ago

magohl commented 7 months ago

What problem did you meet?

Using a social connector of type OIDC i get the ConnectorError when the token response has property expires_in as a string and not a number. The RFC/specification state that this should be a number so LogTo is correct but several other solutions are more forgiving.

{ "path":["expires_in"], "message": "Expected number, received string" }

Describe what you'd like Logto to have

The ability to configure/override the default behavior on the OIDC social connector allowing expires_in as a string.

darcyYe commented 7 months ago

Hi @magohl , thanks for reporting this issue, will record this and make the string-typed timestamp also compatible. Would you like to let us know what IdP you are using?

magohl commented 7 months ago

Hi @darcyYe

Would you like to let us know what IdP you are using?

This specific test was with an national-id provider called Criipto. They have worked perfect with other services i have tried such as Authentik, IdentityServer, AAD B2C, Auth0, Ping etc.

Allowing string-typed expires_to would be great but otherwise maybe a way to override the parsing would be enough. Thanks for looking at this :)

darcyYe commented 6 months ago

Cool, will try to make the OIDC connector work with the IdP you mentioned. Not sure if there are some other issues except for the expires_in type mismatch. It could take few weeks since we have some ongoing projects. Will keep you posted once we have updates. BTW, are you using OSS version or Logto Cloud? Since we have different release flow for them.