Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support openid invitations and deeplinking improvements #97

Merged
merged 5 commits into from
Apr 9, 2024

Conversation

TimoGlastra
Copy link
Member

This PR adds support for deeplinks and invitation urls for OpenID4VC created by Paradym.

It also expanded the parsing logic to be as flexible as possible. That means that:

  • if credential_offer or credential_offer_uri query params, or any of the open id issuance schemes are used in a deeplink or a QR data url we scan we assume it's an openid credential offer
  • if request or request_uri query params, or an of the open id verification schemes are used in a deeplink or a QR data url we scan we assume it's an openid presentation request
  • If oobUrl, oob, c_i, d_m query params or the didcomm schema is used in a deeplink or a qr data url we scan we assume it's didcomm invitation

If it can't be detected from the url alone we fetch the URL and then do anoter set of checks to see what type of invitation it is.

I also made the DIDcomm flow more similar to the openid flow, not showing the QR scanning too long, but redirecting to a loading screen. This also makes the deeplink flow better as it now doesn't do a lot of processing in the background which you can't see

I also added a general umatched route and just render null here. The deeplink handler resets the routing state now on every deeplink so we always route to the correct state (with the downside that you lose your navigation state when you deeplink into an active app, but with the three screen we have that's really a non-issue at the moment IMO). This means that ANY deeplink url (with random paths) now works, and if it isn't a deeplink we support it will just only reset your navigation state (so you'll be on the home screen)..

See attached videos for example flows.

RPReplay_Final1712507731.MP4
RPReplay_Final1712507647.MP4
RPReplay_Final1712507578.MP4

Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Copy link
Member

@Tommylans Tommylans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice solution for the deeplink also the rest is really clear what it does 🚀


// NOTE: for all unmatched routes we render null, as it's good chance that
// we got here due to deep-linking, and we already handle that somewhere else
export default () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite a nicer workaround 👍

success: true,
result: parsedInvitation,
} as const
} else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Else isn't really needed here

Signed-off-by: Timo Glastra <timo@animo.id>
@TimoGlastra TimoGlastra enabled auto-merge (squash) April 9, 2024 08:59
Signed-off-by: Timo Glastra <timo@animo.id>
@TimoGlastra TimoGlastra merged commit 347d7b0 into main Apr 9, 2024
1 check passed
@TimoGlastra TimoGlastra deleted the feat/paradym-openid-invitations branch April 9, 2024 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants