Skip to content

Latest commit

 

History

History
302 lines (192 loc) · 9.06 KB

ApplicationGrantsAPI.md

File metadata and controls

302 lines (192 loc) · 9.06 KB

\ApplicationGrantsAPI

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

GetScopeConsentGrant

OAuth2ScopeConsentGrant GetScopeConsentGrant(ctx, appId, grantId).Expand(expand).Execute()

Retrieve an app Grant

Example

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)
}

Path Parameters

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

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` |

Return type

OAuth2ScopeConsentGrant

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GrantConsentToScope

OAuth2ScopeConsentGrant GrantConsentToScope(ctx, appId).OAuth2ScopeConsentGrant(oAuth2ScopeConsentGrant).Execute()

Grant consent to scope

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
appId string Application ID

Other Parameters

Other parameters are passed through a pointer to a apiGrantConsentToScopeRequest struct via the builder pattern

Name Type Description Notes

oAuth2ScopeConsentGrant | OAuth2ScopeConsentGrant | |

Return type

OAuth2ScopeConsentGrant

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListScopeConsentGrants

[]OAuth2ScopeConsentGrant ListScopeConsentGrants(ctx, appId).Expand(expand).Execute()

List all app Grants

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
appId string Application ID

Other Parameters

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` |

Return type

[]OAuth2ScopeConsentGrant

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RevokeScopeConsentGrant

RevokeScopeConsentGrant(ctx, appId, grantId).Execute()

Revoke an app Grant

Example

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)
    }
}

Path Parameters

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

Other parameters are passed through a pointer to a apiRevokeScopeConsentGrantRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]