All URIs are relative to https://subdomain.okta.com
Method | HTTP request | Description |
---|---|---|
CloseCurrentSession | Delete /api/v1/sessions/me | Close the current Session |
CreateSession | Post /api/v1/sessions | Create a Session with session token |
GetCurrentSession | Get /api/v1/sessions/me | Retrieve the current Session |
GetSession | Get /api/v1/sessions/{sessionId} | Retrieve a Session |
RefreshCurrentSession | Post /api/v1/sessions/me/lifecycle/refresh | Refresh the current Session |
RefreshSession | Post /api/v1/sessions/{sessionId}/lifecycle/refresh | Refresh a Session |
RevokeSession | Delete /api/v1/sessions/{sessionId} | Revoke a Session |
CloseCurrentSession(ctx).Cookie(cookie).Execute()
Close the current Session
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/lukas-hetzenecker/okta-sdk-golang"
)
func main() {
cookie := "sid=abcde-123 or idx=abcde-123" // string | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.SessionAPI.CloseCurrentSession(context.Background()).Cookie(cookie).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SessionAPI.CloseCurrentSession``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Other parameters are passed through a pointer to a apiCloseCurrentSessionRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
cookie | string |
(empty response body)
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Session CreateSession(ctx).CreateSessionRequest(createSessionRequest).Execute()
Create a Session with session token
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/lukas-hetzenecker/okta-sdk-golang"
)
func main() {
createSessionRequest := *openapiclient.NewCreateSessionRequest() // CreateSessionRequest |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.SessionAPI.CreateSession(context.Background()).CreateSessionRequest(createSessionRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SessionAPI.CreateSession``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateSession`: Session
fmt.Fprintf(os.Stdout, "Response from `SessionAPI.CreateSession`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiCreateSessionRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
createSessionRequest | CreateSessionRequest |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Session GetCurrentSession(ctx).Cookie(cookie).Execute()
Retrieve the current Session
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/lukas-hetzenecker/okta-sdk-golang"
)
func main() {
cookie := "sid=abcde-123 or idx=abcde-123" // string | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.SessionAPI.GetCurrentSession(context.Background()).Cookie(cookie).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SessionAPI.GetCurrentSession``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetCurrentSession`: Session
fmt.Fprintf(os.Stdout, "Response from `SessionAPI.GetCurrentSession`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiGetCurrentSessionRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
cookie | string |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Session GetSession(ctx, sessionId).Execute()
Retrieve a Session
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/lukas-hetzenecker/okta-sdk-golang"
)
func main() {
sessionId := "l7FbDVqS8zHSy65uJD85" // string | `id` of the Session
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.SessionAPI.GetSession(context.Background(), sessionId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SessionAPI.GetSession``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetSession`: Session
fmt.Fprintf(os.Stdout, "Response from `SessionAPI.GetSession`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
sessionId | string | `id` of the Session |
Other parameters are passed through a pointer to a apiGetSessionRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Session RefreshCurrentSession(ctx).Cookie(cookie).Execute()
Refresh the current Session
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/lukas-hetzenecker/okta-sdk-golang"
)
func main() {
cookie := "sid=abcde-123 or idx=abcde-123" // string | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.SessionAPI.RefreshCurrentSession(context.Background()).Cookie(cookie).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SessionAPI.RefreshCurrentSession``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `RefreshCurrentSession`: Session
fmt.Fprintf(os.Stdout, "Response from `SessionAPI.RefreshCurrentSession`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiRefreshCurrentSessionRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
cookie | string |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Session RefreshSession(ctx, sessionId).Execute()
Refresh a Session
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/lukas-hetzenecker/okta-sdk-golang"
)
func main() {
sessionId := "l7FbDVqS8zHSy65uJD85" // string | `id` of the Session
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.SessionAPI.RefreshSession(context.Background(), sessionId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SessionAPI.RefreshSession``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `RefreshSession`: Session
fmt.Fprintf(os.Stdout, "Response from `SessionAPI.RefreshSession`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
sessionId | string | `id` of the Session |
Other parameters are passed through a pointer to a apiRefreshSessionRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RevokeSession(ctx, sessionId).Execute()
Revoke a Session
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/lukas-hetzenecker/okta-sdk-golang"
)
func main() {
sessionId := "l7FbDVqS8zHSy65uJD85" // string | `id` of the Session
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.SessionAPI.RevokeSession(context.Background(), sessionId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SessionAPI.RevokeSession``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
sessionId | string | `id` of the Session |
Other parameters are passed through a pointer to a apiRevokeSessionRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]