Replies: 1 comment 9 replies
-
|
This just needs some documentation. There may be a way to simplify this, the second method is specifically what is necessary. The method of achieving this is as follows: if response, err = protocol.ParseCredentialRequestResponseBody(bytes.NewReader(body)); err != nil {
// handle err
return
}
if credential, err = webauthn.ValidateLogin(user, session, response); err != nil {
// handle err
return
}
// handle successWhere ValidateLogin is a function with the following signature: type ValidateLogin func(user User, session SessionData, parsedResponse *protocol.ParsedCredentialAssertionData) (*Credential, error) |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello all,
After studying a bit the library I wonder whether we could evolve some of the library APIs from taking things like
*http.Requestas input to something that is more general and strongly typed. Some users of the library might be using different kinds of protocols (I'm one of those), and those users would be better served if presented with types that are descriptive about what the content of the methods likeFinishLoginexpect rather than a super generic (and implementation-dependant)*http.Request.So I would suggest to go from:
to
where
Some of the benefits for this approach:
WDYT?
p.s.: where applicable we could change types from
[]bytetoURLEncodedBase64Beta Was this translation helpful? Give feedback.
All reactions