-
Notifications
You must be signed in to change notification settings - Fork 166
Added support to enroll passkeys with My Account API #837
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
Conversation
| private val gson: Gson | ||
| ) { | ||
|
|
||
| public val clientId: String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this used for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not required. removed
| * ``` | ||
| * | ||
| * Then, call ``enroll()`` with the created passkey credential and the challenge to complete | ||
| * the enrollment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * the enrollment | |
| * the enrollment. |
| */ | ||
| @Throws(IOException::class) | ||
| public fun fromJson(reader: Reader): T | ||
| public fun fromJson(reader: Reader, headers: Map<String, List<String>>): T |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this be a breaking change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe an overload with a default implementation (so it doesn't break current conformances) would be enough?
That is, leaving the current interface method as-is –and adding a new one that takes both a reader and a headers map, and that has a default implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made this an optional parameter ,so this wouldn't break any existing usage .
| @SerializedName("type") | ||
| val type: String, | ||
| @SerializedName("usage") | ||
| val usage: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to be a field present in the OAS scheme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, this was added recently. I'll have to add it to the iOS implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest not including it as of now, given how the comment in the PR that added it says "This will probably change in future PRs but I'm fine merging as-is.".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
| } | ||
|
|
||
| @Test | ||
| public fun `passkeyEnrollmentChallenge should include correct parameters`() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also include a test case that asserts that, by default, no params are being sent other than "type": "passkey"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
| } | ||
| mockAPI.takeRequest() | ||
| assertThat(error, Matchers.notNullValue()) | ||
| assertThat(error?.message, Matchers.`is`("Authentication ID not found")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be Authentication method ID not found. This is relevant because the error message is developer-facing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
|
|
||
| @RunWith(RobolectricTestRunner::class) | ||
| @Config(manifest = Config.NONE) | ||
| public class MyAccountAPIClientTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we include test cases for when the My Account API returns an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added cases returning error
Changes
This PR adds:
Testing
This change adds unit test coverage
This change adds integration test coverage
This change has been tested on the latest version of the platform/language or why not
Checklist
I have read the Auth0 general contribution guidelines
I have read the Auth0 Code of Conduct
All existing and new tests complete without errors