package example
import (
client "github.com/auth0/go-auth0/management/client"
option "github.com/auth0/go-auth0/management/option"
context "context"
users "github.com/auth0/go-auth0/management/users"
management "github.com/auth0/go-auth0/management"
)
func do() () {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
client.Users.Sessions.List(
context.TODO(),
"user_id",
&users.ListUserSessionsRequestParameters{
From: management.String(
"from",
),
Take: management.Int(
1,
),
},
)
}{
"sessions": [
{
"id": "<string>",
"user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"authenticated_at": "2023-11-07T05:31:56Z",
"idle_expires_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"last_interacted_at": "2023-11-07T05:31:56Z",
"device": {
"initial_user_agent": "<string>",
"initial_ip": "<string>",
"initial_asn": "<string>",
"last_user_agent": "<string>",
"last_ip": "<string>",
"last_asn": "<string>"
},
"clients": [
{
"client_id": "<string>"
}
],
"authentication": {
"methods": [
{
"name": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"type": "<string>"
}
]
},
"cookie": {
"mode": "non-persistent"
},
"session_metadata": {}
}
],
"next": "<string>"
}Retrieve details for a user’s sessions.
package example
import (
client "github.com/auth0/go-auth0/management/client"
option "github.com/auth0/go-auth0/management/option"
context "context"
users "github.com/auth0/go-auth0/management/users"
management "github.com/auth0/go-auth0/management"
)
func do() () {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
client.Users.Sessions.List(
context.TODO(),
"user_id",
&users.ListUserSessionsRequestParameters{
From: management.String(
"from",
),
Take: management.Int(
1,
),
},
)
}{
"sessions": [
{
"id": "<string>",
"user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"authenticated_at": "2023-11-07T05:31:56Z",
"idle_expires_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"last_interacted_at": "2023-11-07T05:31:56Z",
"device": {
"initial_user_agent": "<string>",
"initial_ip": "<string>",
"initial_asn": "<string>",
"last_user_agent": "<string>",
"last_ip": "<string>",
"last_asn": "<string>"
},
"clients": [
{
"client_id": "<string>"
}
],
"authentication": {
"methods": [
{
"name": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"type": "<string>"
}
]
},
"cookie": {
"mode": "non-persistent"
},
"session_metadata": {}
}
],
"next": "<string>"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
ID of the user to get sessions for
Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).
An optional cursor from which to start the selection (exclusive).
Number of results per page. Defaults to 50.
1 <= x <= 100このページは役に立ちましたか?