All URIs are relative to https://subdomain.okta.com
Method | HTTP request | Description |
---|---|---|
GetScopeConsentGrant | Get /api/v1/apps/{appId}/grants/{grantId} | Retrieve an app Grant |
GrantConsentToScope | Post /api/v1/apps/{appId}/grants | Grant consent to scope |
ListScopeConsentGrants | Get /api/v1/apps/{appId}/grants | List all app Grants |
RevokeScopeConsentGrant | Delete /api/v1/apps/{appId}/grants/{grantId} | Revoke an app Grant |
OAuth2ScopeConsentGrant GetScopeConsentGrant(ctx, appId, grantId).Expand(expand).Execute()
Retrieve an app Grant
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/lukas-hetzenecker/okta-sdk-golang"
)
func main() {
appId := "0oafxqCAJWWGELFTYASJ" // string | Application ID
grantId := "iJoqkwx50mrgX4T9LcaH" // string | Grant ID
expand := "scope" // string | An optional parameter to include scope details in the `_embedded` attribute. Valid value: `scope` (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ApplicationGrantsAPI.GetScopeConsentGrant(context.Background(), appId, grantId).Expand(expand).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ApplicationGrantsAPI.GetScopeConsentGrant``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetScopeConsentGrant`: OAuth2ScopeConsentGrant
fmt.Fprintf(os.Stdout, "Response from `ApplicationGrantsAPI.GetScopeConsentGrant`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string | Application ID | |
grantId | string | Grant ID |
Other parameters are passed through a pointer to a apiGetScopeConsentGrantRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
expand | string | An optional parameter to include scope details in the `_embedded` attribute. Valid value: `scope` |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
OAuth2ScopeConsentGrant GrantConsentToScope(ctx, appId).OAuth2ScopeConsentGrant(oAuth2ScopeConsentGrant).Execute()
Grant consent to scope
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/lukas-hetzenecker/okta-sdk-golang"
)
func main() {
appId := "0oafxqCAJWWGELFTYASJ" // string | Application ID
oAuth2ScopeConsentGrant := *openapiclient.NewOAuth2ScopeConsentGrant("https://my_test_okta_org.oktapreview.com", "okta.users.read") // OAuth2ScopeConsentGrant |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ApplicationGrantsAPI.GrantConsentToScope(context.Background(), appId).OAuth2ScopeConsentGrant(oAuth2ScopeConsentGrant).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ApplicationGrantsAPI.GrantConsentToScope``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GrantConsentToScope`: OAuth2ScopeConsentGrant
fmt.Fprintf(os.Stdout, "Response from `ApplicationGrantsAPI.GrantConsentToScope`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string | Application ID |
Other parameters are passed through a pointer to a apiGrantConsentToScopeRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
oAuth2ScopeConsentGrant | OAuth2ScopeConsentGrant | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]OAuth2ScopeConsentGrant ListScopeConsentGrants(ctx, appId).Expand(expand).Execute()
List all app Grants
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/lukas-hetzenecker/okta-sdk-golang"
)
func main() {
appId := "0oafxqCAJWWGELFTYASJ" // string | Application ID
expand := "scope" // string | An optional parameter to include scope details in the `_embedded` attribute. Valid value: `scope` (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ApplicationGrantsAPI.ListScopeConsentGrants(context.Background(), appId).Expand(expand).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ApplicationGrantsAPI.ListScopeConsentGrants``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListScopeConsentGrants`: []OAuth2ScopeConsentGrant
fmt.Fprintf(os.Stdout, "Response from `ApplicationGrantsAPI.ListScopeConsentGrants`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string | Application ID |
Other parameters are passed through a pointer to a apiListScopeConsentGrantsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
expand | string | An optional parameter to include scope details in the `_embedded` attribute. Valid value: `scope` |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RevokeScopeConsentGrant(ctx, appId, grantId).Execute()
Revoke an app Grant
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/lukas-hetzenecker/okta-sdk-golang"
)
func main() {
appId := "0oafxqCAJWWGELFTYASJ" // string | Application ID
grantId := "iJoqkwx50mrgX4T9LcaH" // string | Grant ID
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.ApplicationGrantsAPI.RevokeScopeConsentGrant(context.Background(), appId, grantId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ApplicationGrantsAPI.RevokeScopeConsentGrant``: %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. | |
appId | string | Application ID | |
grantId | string | Grant ID |
Other parameters are passed through a pointer to a apiRevokeScopeConsentGrantRequest 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]