dfinity / agent-js

A collection of libraries and tools for building software around the Internet Computer, in JavaScript.
https://agent-js.icp.xyz
Apache License 2.0
154 stars 95 forks source link

feat: support for restricting II auth methods #856

Closed krpeacock closed 7 months ago

krpeacock commented 7 months ago

Description

Adds new security features from the II login flow for restricting authentication types: https://github.com/dfinity/internet-identity/blob/6c345912457ca93bf3175ce3382a1ddf8ff46eca/docs/ii-spec.md#client-authentication-protocol

New Login method allows developers to restrict users from authenticating using a PIN image

Also allows onSuccess to pass through the message from the IDP provider, allowing developers to access the new authnMethod field

image

Fixes # (issue)

How Has This Been Tested?

Tested manually after building and installing in https://github.com/krpeacock/auth-client-demo

Checklist:

github-actions[bot] commented 7 months ago

size-limit report 📦

Path Size
@dfinity/agent 101.81 KB (0%)
@dfinity/candid 13.61 KB (0%)
@dfinity/principal 5.04 KB (0%)
@dfinity/auth-client 92.77 KB (+0.02% 🔺)
@dfinity/assets 93.43 KB (0%)
@dfinity/identity 89.98 KB (0%)
@dfinity/identity-secp256k1 281.19 KB (0%)
krpeacock commented 7 months ago

Looking great, thanks! Have you tried it out? I think the feature's live in II already

Yep - the screenshot was from mainnet