Skip to content

Use PAR#53

Merged
janmeier merged 5 commits into
masterfrom
upgrade-auth-js
Jun 8, 2026
Merged

Use PAR#53
janmeier merged 5 commits into
masterfrom
upgrade-auth-js

Conversation

@janmeier

@janmeier janmeier commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

This should probably be considered a breaking change, since the PAR request is susceptible to CORS. So if you start on https://login.example.com, and the redirect URL is https://app.example.com, and only https://app.example.com is allowed as redirect URL - the PAR request will be blocked by CORS.

@netlify

netlify Bot commented Mar 19, 2026

Copy link
Copy Markdown

Deploy Preview for criipto-verify-react-storybook ready!

Name Link
🔨 Latest commit 0e8ca4d
🔍 Latest deploy log https://app.netlify.com/projects/criipto-verify-react-storybook/deploys/6a0d963a9e0fd40008dbbc75
😎 Deploy Preview https://deploy-preview-53--criipto-verify-react-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment thread src/components/AuthMethodButton.tsx
Comment thread src/components/AuthMethodButton.tsx Outdated
@janmeier janmeier marked this pull request as ready for review March 23, 2026 08:48
@janmeier janmeier requested review from jlndk and mickhansen March 23, 2026 08:49
@janmeier

Copy link
Copy Markdown
Contributor Author

Tagging @jlndk for review alongside mhantheman here. Just to easy the review burden on Mick as bit :)

Comment thread src/components/AuthMethodButton.tsx Outdated
Comment thread src/provider.tsx Outdated
@mickhansen

Copy link
Copy Markdown
Collaborator

Few commits would benefit from the "why"

Comment thread src/components/AuthMethodButton.tsx
@janmeier janmeier force-pushed the upgrade-auth-js branch 2 times, most recently from aec1b49 to 33afe99 Compare March 23, 2026 10:33
@janmeier janmeier requested a review from mickhansen March 23, 2026 10:33
@janmeier

Copy link
Copy Markdown
Contributor Author

@mickhansen - rdy for re-review. I reworded some commits, so no fixups unfortunately,

@jlndk jlndk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks awesome!

Comment thread src/components/AuthMethodButton/AuthMethodButton.css Outdated
Comment thread src/components/Spinner/Spinner.css Outdated
Comment on lines +2 to +6
width: 24px;
height: 24px;
border: 3px solid #fff;
border-bottom-color: transparent;
border-radius: 50%;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For visual consistency it may be nice to use a real font-awesome icon instead of using css to make a shape (unless there's some icon being added elsewhere which I can't see in this diff).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree, but I don't think we have permission to distribute it :). The spinner we use is part of the pro package

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah, right!

Probably slightly out of scope, but it would be great if we could set up package resolution such that we can use the free FA icons by default and then overwrite them with the pro packages at distribution-/deploy- time.

Would also be great for docs 🙏🏻

For now I would almost vote for a free icon being better than none. Opinion @Trinurt?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@jlndk The problem is that the free Fontawesome icons do not include Sharp and Light. Maybe we need to make a separate PR/discussion for this issue and look in to smart options?

Fontawesome free icons:
image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@jlndk The problem is that the free Fontawesome icons do not include Sharp and Light. Maybe we need to make a separate PR/discussion for this issue and look in to smart options?

Fontawesome free icons: image

Yes that was my entire point, that we could consider developing with free-regular here in the public repos and then it would be swapped out with the real icons at deploy-time.

But yes, could definitely qualify for out-of-scope in terms of this PR :D @Trinurt

@mickhansen mickhansen Mar 25, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@jlndk How about I add the PRO spinner icon to our custom Fontawesome icon set (takes 10 min) so we can use it for all loading states on all buttons everywhere? (maybe till out of scope for this pr though)

@Trinurt That sounds like it could still violate the terms of redistribution?
Or do you mean you would custom design your own spinner icon - i.e. not extract it from Fontawesome? (What makes something a custom fontawesome icon?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@janmeier Aye the free we can, the question was whether we can publish an npm package with the pro icons :) I would think probably not.

Definitely not :)

Creators may not make, share, or publish standalone copies of Pro Icons or Pro Software for non-Creators. For the purpose of clarity (and not for limitation), the use of Pro Icons or Pro Icons Software must constitute a new or separate work. Making, sharing, or publishing copies of Pro Icons or Pro Software in a non-transformative way or in a manner where the Pro Icons or Pro Software are the primary part of what is being made, shared, or published is expressly prohibited.

Creators may not give non-Creators permission to Embed Pro Icons in new Projects of their own, or to Embed them in Projects in new ways. Similarly, Creators may not give non-Creators permission to use Pro Icons or Projects that embed Pro Icons for further use or resale.

https://fontawesome.com/license/#what-creators-may-not-do

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think finding a way to use the pro spinner in our own products (ie Verify) is out of scope for this PR.

So we have the following options:

  • Keep using the existing "moving dots" loader
  • Use a free font awesome icon everywhere
  • Use another free CSS spinner (which is have I've done here)

@Trinurt Trinurt Mar 25, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Custom icons are custom icons - I have already made (designed as svg in Figma and uploaded to FA) three custom icons because FA PRO didn't offer the illustration I was looking for.

As for the spinner I can see that I was a little too smart - I can of course not copy the pro and add it to our custom icon kit. But I can design a custom spinner with an IDURA twist and upload it to our custom kit so we can use it on all buttons in all apps and channels. Is that part of this PR though?

image

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

But I can design a custom spinner with an IDURA twist and upload it to our custom kit so we can use it on all buttons in all apps and channels.

Sounds like a good way forward.
But out of scope for PR I would say.

Comment thread src/components/Spinner/Spinner.css
Comment thread src/components/AuthMethodButton.tsx
@janmeier

Copy link
Copy Markdown
Contributor Author

@Trinurt Deploy preview updated with HSL, and increasing lightness for FTN and OneID

@janmeier janmeier requested a review from jlndk March 24, 2026 11:31
@janmeier janmeier force-pushed the upgrade-auth-js branch 4 times, most recently from c7290b1 to 5dcae51 Compare March 27, 2026 12:56
@mickhansen mickhansen removed their request for review April 23, 2026 09:01
@mickhansen

Copy link
Copy Markdown
Collaborator

Request me when ready again :)

@janmeier janmeier force-pushed the upgrade-auth-js branch 4 times, most recently from 9bd8b22 to 79701c1 Compare April 27, 2026 09:27
@janmeier janmeier force-pushed the upgrade-auth-js branch 5 times, most recently from dbc5ca8 to 17fe9fe Compare April 28, 2026 11:01
@janmeier

Copy link
Copy Markdown
Contributor Author

@mickhansen Should be ready for another review now.

I split the disabled state handling into a separate PR, which is already merged.

To recap:

  • If props.href is not set in AuthMethodButton, we use PAR. I'm guessing that verify might sometimes pass a href, so I left it in
  • On error, we call context.handleResponse, which bubbles the error to the hook. So any PAR related error will be returned to the consumer there.
  • In useCriiptoVerify, I am calling fetchCriiptoConfiguration to verify the domain and client id. This should help consumers catch CORS related errors earlier.

@janmeier janmeier force-pushed the upgrade-auth-js branch 5 times, most recently from c94a34f to d356fa6 Compare April 29, 2026 07:28
@janmeier

Copy link
Copy Markdown
Contributor Author

🏓 @mickhansen

@mickhansen

Copy link
Copy Markdown
Collaborator

@janmeier conflicts

janmeier added 5 commits May 20, 2026 13:08
This will allow us to use PAR.
Also known as [pushed authorization request](https://datatracker.ietf.org/doc/html/rfc9126).

Pushing the authorization request upfront has several benefits:
* Prevents an attacker from modifying OIDC parameters
* Does not leak any parameters in logs
* Prevents OIDC URLs from growing too large
…loading

When we show several buttons together in a group, we want to disable _all_ buttons, when the user clicks one of them. Therefore, we add a disabled state on `AuthButtonGroupContextInterface`.

`AuthButtonGroupContextInterface` provides a stub default value, so even if a button is _not_ rendered in a group, it is safe to call `setDisabled()`.
This will try to verify that the domain and client ID are correct, and throw if not.

This should be considered a breaking change, since just calling the `useCriiptoVerify` hook  will now throw an error, if the domain is not valid.
With the introduction of PAR, we will now always do a CORS request (the /par/init request). So we move the CORS notice further up in the README.
@janmeier janmeier merged commit 77e2e53 into master Jun 8, 2026
6 checks passed
@janmeier janmeier deleted the upgrade-auth-js branch June 8, 2026 08:23
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.

4 participants