Possible to get user's token by user id?

Just a quick question.

Does it possible to get the user’s token by user id ?

Thanks.

You mean the access token? No.

Ok thanks so much, I will find what I can do.

Because I want just to keeping tracks who doing what :smiley:

You can have a look to the history endpoint:

1 Like

Thanks, but I see just [GET] :smiley:

You have not mentioned that you also wanna do something. This is just a list of events and changes in your app.

Yeah, but the important part is who did it.

Example

  • Create a new client (access token)
  • All admins (outside the Squidex) using the same client/token.

I don’t understand. The endpoint has an “actor” property to answer the “who” question.

Oh, can you explain about “actor” please or link to doc ?

Actor is either a client

client:clientID
e.g.
client:my-app:my-client

or a user

subject:userID

e.g.
subject:123123123123123
1 Like

Ohhhhhhh, we can do like this!

thanks so much. I will take a look more.

1 Like

Hi again,

How can we use subject:userID ? where ?

This is when we getting token ? or when create a page? or what?

Thanks.

This just identifies the user. You can then get user details with this endpoint: https://cloud.squidex.io/api/docs#tag/Users/operation/Users_GetUser

Yes, but do you have to doc I can read about identifies the user?

subject:userID

e.g.
subject:123123123123123

I don’t get it. What is your question?

This is your answer, I just need more info what do you mean by using:

subject:userID

e.g.
subject:123123123123123

I used many hours to research about actor / subject / oauth / openid / Squidex docs
Still dont know what is that :smiley:

Example:

const token = await axios({
  method: 'POST',
  url: '/identity-server/connect/token',
  headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  data: queryString.stringify({
    grant_type: 'client_credentials',
    scope: 'squidex-api openid profile email permissions',
    client_id: 'app:default',
    client_secret: '…',
    acr_values: 'subject:63d7aad1ec27df37b9eb2bb1', // That what I tried also
  }),
})

or I misunderstood the whole point?

Yes

You totally missed the point. As I said: You cannot get the access token of a user and nothing has changed. But you said you want to know who did what and you might be able to answer this with the history endpoint.

The actor string is just an identifier which either represents a client (client:<APP_NAME>:<CLIENT_ID>) or user (subject:<USER_ID>)

1 Like

Oh ok, I misunderstood.

So that means it’s no way to create a post/page with existing user (by user id) also right?
(when access token from domain.com/app/settings/clients)

No, if you need that, you have to create a field for that and track it yourself.

1 Like