From 12f8c7202c49aa7cba30c4cc7e1d857bfa53a49c Mon Sep 17 00:00:00 2001 From: Livio Amstutz Date: Mon, 7 Dec 2020 15:22:11 +0100 Subject: [PATCH] fix(grpc): return CredentialCreationData in webauthn public key (#1075) --- internal/api/grpc/auth/user_converter.go | 2 +- internal/user/repository/eventsourcing/eventstore.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/api/grpc/auth/user_converter.go b/internal/api/grpc/auth/user_converter.go index 59b9daa844..0f1756854c 100644 --- a/internal/api/grpc/auth/user_converter.go +++ b/internal/api/grpc/auth/user_converter.go @@ -431,7 +431,7 @@ func userChangesToAPI(changes *usr_model.UserChanges) (_ []*auth.Change) { func verifyWebAuthNFromModel(u2f *usr_model.WebAuthNToken) *auth.WebAuthNResponse { return &auth.WebAuthNResponse{ Id: u2f.WebAuthNTokenID, - PublicKey: u2f.PublicKey, + PublicKey: u2f.CredentialCreationData, State: mfaStateFromModel(u2f.State), } } diff --git a/internal/user/repository/eventsourcing/eventstore.go b/internal/user/repository/eventsourcing/eventstore.go index 371f0c74bc..6d553a3492 100644 --- a/internal/user/repository/eventsourcing/eventstore.go +++ b/internal/user/repository/eventsourcing/eventstore.go @@ -1316,6 +1316,7 @@ func (es *UserEventstore) AddU2F(ctx context.Context, userID string) (*usr_model return nil, err } webAuthN.WebAuthNTokenID = tokenID + webAuthN.State = usr_model.MFAStateNotReady repoUser := model.UserFromModel(user) repoWebAuthN := model.WebAuthNFromModel(webAuthN)