Skip to content
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

Help needed for api uses. ListUsers() gives internal error for zitadel cloud #410

Open
msonawane opened this issue Dec 3, 2024 · 8 comments
Labels
question Further information is requested

Comments

@msonawane
Copy link

msonawane commented Dec 3, 2024

Hello,
I could use some help getting following example working.

ctx := context.Background()
client, err := user.NewClient(ctx,
		cfg.Issuer,
		cfg.API,
		[]string{oidc.ScopeOpenID, zitadel.ScopeZitadelAPI()},
		zitadel.WithJWTProfileTokenSource(middleware.JWTProfileFromPath(ctx, cfg.JWTProfilePath)),
	)
	if err != nil {
		return nil, err
	}
resp, err := client.ListUsers(ctx, &user.ListUsersRequest{})
	if err != nil {
		fmt.Printf("err : %#v\n", err)
	}

returned error
err : &oidc.Error{Parent:error(nil), ErrorType:"server_error", Description:"Errors.Internal", State:"", redirectDisabled:false, returnParent:false}

@msonawane msonawane changed the title Help needed for api uses. ListUsers() gives internam error for zitadel cloud Help needed for api uses. ListUsers() gives internal error for zitadel cloud Dec 3, 2024
@hifabienne hifabienne moved this to 🧐 Investigating in Product Management Dec 3, 2024
@hifabienne hifabienne added the question Further information is requested label Dec 3, 2024
@hifabienne
Copy link
Member

@livio-a can you help here?

@msonawane
Copy link
Author

msonawane commented Dec 4, 2024

Any pointers to solve this would be helpful. I'm new to Zitadel. Is there a place where I can view logs for projects, instances, or applications in the Zitadel console?

@livio-a
Copy link
Member

livio-a commented Dec 5, 2024

@msonawane That looks like some internal error happened during the authentication of the service account.
Can you send me some details (at least instanceID and time you last tried), e.g. through the customer portal?

@msonawane
Copy link
Author

Thanks @livio-a. The following is information, I tried to list users a few minutes back
"appId": "296481562243909531",
"clientId": "296481562243975067"
instance https://aryadev-3pbajd.us1.zitadel.cloud/

@msonawane
Copy link
Author

@livio-a any help please?

@livio-a
Copy link
Member

livio-a commented Dec 6, 2024

Did you use a service account or an application's key for the JWT profile path?
For machine to machine communication, you'll need to use a service account in ZITADEL.
The application is only needed for signing in users to that or an API as OAuth resource server.

@msonawane
Copy link
Author

@livio-a
that was it. I was using an application key. with a service account listUsers works. Thanks!
I am now trying to use AddHumanUser to register a new user in zitadel and looks like AddHumanUserRequest struct has no password field.
Do we have any examples about how to use go SDK? Any pointers to documents / tests will be really helpful

@msonawane
Copy link
Author

well I found setpassword method in go SDK

@hifabienne @livio-a If you have some time, could you please direct me to the documentation or tests for the Go SDK that demonstrate the following:

  • Registering a user
  • Changing a password
  • How do you adapt the Go SDK for different routers (such as Echo, etc.)?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
Status: 🧐 Investigating
Development

No branches or pull requests

3 participants