Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions .generator/okta-management-APIs-oasv3-noEnums-inheritance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31913,9 +31913,7 @@ components:
type: string
profile:
type: object
additionalProperties:
type: object
properties: {}
additionalProperties: true
_embedded:
type: object
additionalProperties:
Expand Down Expand Up @@ -32658,9 +32656,7 @@ components:
readOnly: true
detailEntry:
type: object
additionalProperties:
type: object
properties: {}
additionalProperties: true
readOnly: true
displayName:
type: string
Expand Down Expand Up @@ -33128,9 +33124,7 @@ components:
properties:
detail:
type: object
additionalProperties:
type: object
properties: {}
additionalProperties: true
readOnly: true
id:
type: string
Expand Down Expand Up @@ -33827,9 +33821,7 @@ components:
profile:
type: object
description: Contains any valid JSON schema for specifying properties that can be referenced from a request (only available to OAuth 2.0 client apps)
additionalProperties:
type: object
properties: {}
additionalProperties: true
settings:
$ref: '#/components/schemas/OINBaseSignOnModeApplicationSettings'
signOnMode:
Expand Down
8 changes: 8 additions & 0 deletions .generator/templates/client.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ func (a *PrivateKeyAuth) Authorize(method, URL string) error {
return err
}

if accessToken == nil {
return errors.New("Empty access token")
}

a.req.Header.Set("Authorization", fmt.Sprintf("%v %v", accessToken.TokenType, accessToken.AccessToken))
if accessToken.TokenType == "DPoP" {
dpopJWT, err := generateDpopJWT(privateKey, method, URL, nonce, accessToken.AccessToken)
Expand Down Expand Up @@ -288,6 +292,10 @@ func (a *JWTAuth) Authorize(method, URL string) error {
return err
}

if accessToken == nil {
return errors.New("Empty access token")
}

a.req.Header.Set("Authorization", fmt.Sprintf("%v %v", accessToken.TokenType, accessToken.AccessToken))
if accessToken.TokenType == "DPoP" {
dpopJWT, err := generateDpopJWT(privateKey, method, URL, nonce, accessToken.AccessToken)
Expand Down
6 changes: 6 additions & 0 deletions .generator/templates/configuration.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,12 @@ func WithScopes(scopes []string) ConfigSetter {
}
}

func WithDebug(debug bool) ConfigSetter {
return func(c *Configuration) {
c.Debug = debug
}
}

// WithPrivateKey sets private key key. Can be either a path to a private key or private key itself.
func WithPrivateKey(privateKey string) ConfigSetter {
return func(c *Configuration) {
Expand Down