zitadel-go icon indicating copy to clipboard operation
zitadel-go copied to clipboard

Allow usage of personal access tokens besides JWT Profile

Open fforootd opened this issue 2 years ago • 6 comments

I think we should also allow to use PATs with this library and not only JWT profile.

fforootd avatar Jul 21 '22 14:07 fforootd

@hifabienne @livio-a FYI

fforootd avatar Jul 21 '22 14:07 fforootd

Hello, Is there any workaround while this is implemented ?

MinDBreaK avatar Nov 13 '23 09:11 MinDBreaK

Hello, Is there any workaround while this is implemented ?

No not ATM, but out of curiosity what is hindering you to use a keyfile (the json zitadel generates for you)?

fforootd avatar Nov 15 '23 09:11 fforootd

I am using the access token of a user to retrieve the list of the organizations it has access to, but I need to introspect the token. I might have missed the API that allow the inspection of another token ?

Probably the same as #186 I think, with the PR linked

MinDBreaK avatar Nov 15 '23 10:11 MinDBreaK

I am using the access token of a user to retrieve the list of the organizations it has access to, but I need to introspect the token. I might have missed the API that allow the inspection of another token ?

Probably the same as #186 I think, with the PR linked

The introspection endpoint needs a client authentication, in zitadel called an "api client" which will give you a json with a private key.

IMO it should be sufficient to setup the api client json (as key) and then to pass the token you have from the user to the sdk.

Somewhat like in this example https://github.com/zitadel/zitadel-go/blob/main/example/http/http.go

fforootd avatar Nov 15 '23 12:11 fforootd

I need to execute request against Zitadel API with the context of the user. I'm using it's PAT to do this. I went with the solution mentioned in https://github.com/zitadel/zitadel-go/issues/212#issuecomment-1694351909

This is fine by me, But I think maybe some methods could be renamed as we are not exactly using "JWT" to access the API.

The keyfile could be used, but I would also like the ability to use env vars for example (unrelated issue)

MinDBreaK avatar Nov 20 '23 13:11 MinDBreaK