zitadel / zitadel-go

ZITADEL Go - The official client library of ZITADEL for an easy integration into your Go project.
https://zitadel.com
Apache License 2.0
73 stars 29 forks source link

Missing Grpc endpoint to validate phone verification code #254

Closed dani3lsf closed 1 year ago

dani3lsf commented 1 year ago

Using the zitadel grpc management api implementation is possible via ImportHumanUser to create a new user requesting the phone verification by setting the IsPhoneVerified bool to false. Its also possible to resend the phone verification code using the call ResendHumanPhoneVerification, however I don't seem to find any call that I can use to actually verify the receiving code by the user.

Looking up in the rest api such endpoint exists in the /v2beta path prefix https://zitadel.com/docs/apis/resources/user_service/user-service-verify-phone#verify-the-phone and it works flawlessly. Such endpoint would be quite useful in the grpc implementation as well. Is there already any plan for its implementation already?

Thank you in advance

hifabienne commented 1 year ago

Hei @dani3lsf

The endpoint that you mention is not only a rest API, but also grpc. So I think you should be able to use it. It's just a different service. User Service instead of management Service. https://github.com/zitadel/zitadel/blob/main/proto/zitadel/user/v2beta/user_service.proto#L217C71-L217C71

We are slowly migrating to a resource based API, where we started with the endpoints needed for beeing able to build your own login and register UI. So the user service is already from the new resource based API, while the management API, is the old one. If you want to know more about that you can find it in the following blog: https://zitadel.com/blog/resource-api

dani3lsf commented 1 year ago

@hifabienne thank you for the answer. Such Grpc endpoint is however not yet incorporated in the zitadel-go package right or am I confusing stuff?

hifabienne commented 1 year ago

@hifabienne thank you for the answer. Such Grpc endpoint is however not yet incorporated in the zitadel-go package right or am I confusing stuff?

No I was confused 😁 Didn't realize you are asking in the zitadel-go You are right this is not yet in there. I think there should be a VerifyMyPhone in the auth api. As the user should verify his phone number byhimself, I guess this API should work. I think that is also the reason, why it is not in the management api.

dani3lsf commented 1 year ago

No worries :). For now I can use the rest implementation of the v2beta path to verify the code on behalf of the user. Just to get a full picture, for the future the plan is to update the language sdks like zitadel-go with the resource based api implementation? Or will you deprecate such repos? because those are really useful.

hifabienne commented 1 year ago

Yes exactly. We will update the sdks in the future.