nilsense
nilsense
ZZITADEL
Created by nilsense on 5/14/2025 in #questions-help-bugs
Flaky error from /oauth/v2/token
Thanks @Rajat ! I understand the miss due to the test coverage, but I'm most afraid that some of these things will not get fixed before support for v2 expires. I appreciate advocating having someone on your team look at the issue. Thanks Rajat!
15 replies
ZZITADEL
Created by nilsense on 5/14/2025 in #questions-help-bugs
Flaky error from /oauth/v2/token
Just tracing the error more or less. I wasn't exactly sure if it was something I was doing wrong on my side or Zitadel's side. But confirming the issue, how it is caused, and a potential path to resolve it would help me get in further (if I have time).
15 replies
ZZITADEL
Created by nilsense on 5/14/2025 in #questions-help-bugs
Flaky error from /oauth/v2/token
Hey there @Rajat, thanks for getting back to me. I'm generally willing to contribute but it would depend on the context as well. I've already spent a lot of time trying to figure it out (unsuccessfully). Let me know what your people say and we can go from there! (Hoping to get this solved in v2 if possible)
15 replies
ZZITADEL
Created by nilsense on 5/14/2025 in #questions-help-bugs
Flaky error from /oauth/v2/token
bump
15 replies
ZZITADEL
Created by nilsense on 5/22/2025 in #questions-help-bugs
-debug vs non -debug Zitadel images on ghcr
bump
5 replies
ZZITADEL
Created by nilsense on 5/14/2025 in #questions-help-bugs
Flaky error from /oauth/v2/token
@Rajat Anyway you could take a look at this too?
15 replies
ZZITADEL
Created by nilsense on 5/20/2025 in #questions-help-bugs
Is there a GO SDK Replacement for Rest /oath/v2/token
Thanks for the reply @Rajat!
5 replies
ZZITADEL
Created by nilsense on 5/14/2025 in #questions-help-bugs
Flaky error from /oauth/v2/token
I have opened a Github issue bug here
15 replies
ZZITADEL
Created by nilsense on 5/14/2025 in #questions-help-bugs
Flaky error from /oauth/v2/token
Thank you. I've gone through the documentation and am asking becasue I can't find the API that matches that endpoint. **
15 replies
ZZITADEL
Created by nilsense on 5/14/2025 in #questions-help-bugs
Flaky error from /oauth/v2/token
Would also appreciate if someone is able to point me to the go sdk that I can replace the rest call to /oauth/v2/token, (which is what I use for getZitadelUserToken(testUserSecret, userTokenExpiry)
15 replies
ZZITADEL
Created by nilsense on 5/14/2025 in #questions-help-bugs
Flaky error from /oauth/v2/token
Here is a sample of some of my test flow:
userResp, err := zitadelClient.AddMachineUser(tenant1Secret.OrgId, t.Name(), "My Machine Account", "First machine account used for API XY.", user.AccessTokenType_ACCESS_TOKEN_TYPE_BEARER)
require.NoError(t, err)
testUserId := userResp.GetUserId()

user, err := zitadelClient.GetMachineUserByName(tenant1Secret.OrgId, t.Name())
require.NoError(t, err)
require.NotNil(t, user)
require.Equal(t, user.UserId, testUserId)

_, err = zitadelClient.AddPersonalAccessToken(tenant1Secret.OrgId, testUserId, &timestamppb.Timestamp{Seconds: time.Now().Add(time.Minute*10).UnixMilli() / 1000})
require.NoError(t, err)
//testPat := token.GetToken()

key, err := zitadelClient.AddMachineKey(tenant1Secret.OrgId, testUserId, &timestamppb.Timestamp{Seconds: time.Now().Add(time.Minute*10).UnixMilli() / 1000}, true)
require.NoError(t, err)
var testUserSecret apiSecret
err = json.Unmarshal(key.GetKeyDetails(), &testUserSecret)
require.NoError(t, err)
testUserSecret.ProjectId = tenant1Secret.UserSecret.ProjectId
testUserSecret.TenantId = tenant1Secret.UserSecret.TenantId
testUserSecret.Domain = tenant1Secret.UserSecret.Domain
require.Equal(t, testUserSecret.secret.UserId, testUserId)

// TODO: Use native zitadel client
userTokenExpiry := time.Now().Add(time.Hour).Unix()
_, err = getZitadelUserToken(testUserSecret, userTokenExpiry)
require.NoError(t, err) **//FAILS HERE**

// TODO: Remove
zitadelClient.RemoveUser(tenant1Secret.OrgId, testUserId)
userResp, err := zitadelClient.AddMachineUser(tenant1Secret.OrgId, t.Name(), "My Machine Account", "First machine account used for API XY.", user.AccessTokenType_ACCESS_TOKEN_TYPE_BEARER)
require.NoError(t, err)
testUserId := userResp.GetUserId()

user, err := zitadelClient.GetMachineUserByName(tenant1Secret.OrgId, t.Name())
require.NoError(t, err)
require.NotNil(t, user)
require.Equal(t, user.UserId, testUserId)

_, err = zitadelClient.AddPersonalAccessToken(tenant1Secret.OrgId, testUserId, &timestamppb.Timestamp{Seconds: time.Now().Add(time.Minute*10).UnixMilli() / 1000})
require.NoError(t, err)
//testPat := token.GetToken()

key, err := zitadelClient.AddMachineKey(tenant1Secret.OrgId, testUserId, &timestamppb.Timestamp{Seconds: time.Now().Add(time.Minute*10).UnixMilli() / 1000}, true)
require.NoError(t, err)
var testUserSecret apiSecret
err = json.Unmarshal(key.GetKeyDetails(), &testUserSecret)
require.NoError(t, err)
testUserSecret.ProjectId = tenant1Secret.UserSecret.ProjectId
testUserSecret.TenantId = tenant1Secret.UserSecret.TenantId
testUserSecret.Domain = tenant1Secret.UserSecret.Domain
require.Equal(t, testUserSecret.secret.UserId, testUserId)

// TODO: Use native zitadel client
userTokenExpiry := time.Now().Add(time.Hour).Unix()
_, err = getZitadelUserToken(testUserSecret, userTokenExpiry)
require.NoError(t, err) **//FAILS HERE**

// TODO: Remove
zitadelClient.RemoveUser(tenant1Secret.OrgId, testUserId)
15 replies