Skip to content

Commit 90b60d8

Browse files
Merge pull request #460 from okta/prep-release-4.1.0
prep release 4.1.0
2 parents 097ef41 + 8f520c2 commit 90b60d8

3 files changed

Lines changed: 21 additions & 7 deletions

File tree

.generator/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ additionalProperties:
88
enumClassPrefix: true
99
generateInterfaces: true
1010
packageName: okta
11-
packageVersion: 4.0.0
11+
packageVersion: 4.1.0
1212
useOneOfDiscriminatorLookup: true
1313
disallowAdditionalPropertiesIfNotPresent: false
1414
files:

.generator/templates/client.mustache

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,12 @@ func getAccessTokenForPrivateKey(httpClient *http.Client, orgURL, clientAssertio
396396
tokenResponse.Body = origResp
397397
var accessToken *RequestAccessToken
398398

399-
if tokenResponse.StatusCode >= 400 && strings.Contains(string(respBody), "invalid_dpop_proof") {
400-
return getAccessTokenForDpopPrivateKey(tokenRequest, httpClient, orgURL, "", maxRetries, maxBackoff)
399+
if tokenResponse.StatusCode >= 300 {
400+
if strings.Contains(string(respBody), "invalid_dpop_proof") {
401+
return getAccessTokenForDpopPrivateKey(tokenRequest, httpClient, orgURL, "", maxRetries, maxBackoff)
402+
} else {
403+
return nil, "", nil, err
404+
}
401405
}
402406

403407
_, err = buildResponse(tokenResponse, nil, &accessToken)
@@ -436,9 +440,14 @@ func getAccessTokenForDpopPrivateKey(tokenRequest *http.Request, httpClient *htt
436440
if err != nil {
437441
return nil, "", nil, err
438442
}
439-
if tokenResponse.StatusCode >= 400 && strings.Contains(string(respBody), "use_dpop_nonce") {
440-
newNonce := tokenResponse.Header.Get("Dpop-Nonce")
441-
return getAccessTokenForDpopPrivateKey(tokenRequest, httpClient, orgURL, newNonce, maxRetries, maxBackoff)
443+
444+
if tokenResponse.StatusCode >= 300 {
445+
if strings.Contains(string(respBody), "use_dpop_nonce") {
446+
newNonce := tokenResponse.Header.Get("Dpop-Nonce")
447+
return getAccessTokenForDpopPrivateKey(tokenRequest, httpClient, orgURL, newNonce, maxRetries, maxBackoff)
448+
} else {
449+
return nil, "", nil, err
450+
}
442451
}
443452
origResp := io.NopCloser(bytes.NewBuffer(respBody))
444453
tokenResponse.Body = origResp

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
# Changelog
22
Running changelog of releases since `2.0.0-rc.4`
33

4+
## v4.1.0
5+
- Add support for dpop (#454) Thanks [@duytiennguyen-okta]
6+
- Fix object that does not have additional properties (#456) Thanks [@duytiennguyen-okta]
7+
- Fix header accept issue that only accept application/json (#457) Thanks [@duytiennguyen-okta]
8+
49
## v4.0.0
5-
- Release v4 version of the sdk base on openapi spec v3 (#427) Thanks [@duytiennguyen-okta]
10+
- Release v4 version of the sdk base on openapi spec v3 (#4) Thanks [@duytiennguyen-okta]
611

712
## v2.19.0
813
- Upgrade dependency (#378) Thanks [@duytiennguyen-okta]

0 commit comments

Comments
 (0)