Skip to content

Commit 74c3823

Browse files
committed
Github:17805 (Fix issueutilize privateKey only during initialization)
1 parent 0953114 commit 74c3823

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Project/Sources/Classes/OAuth2Provider.4dm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ Function _getToken_Service() : Object
608608

609609
var $result : Object:=Null
610610
var $params : cs.URL:=cs.URL.new()
611-
var $jwt : cs.JWT:=cs.JWT.new()
611+
var $jwt : cs.JWT:=cs.JWT.new(This.privateKey)
612612
var $options : Object
613613
var $bearer : Text
614614

@@ -626,7 +626,7 @@ Function _getToken_Service() : Object
626626
$options.payload.sub:=This.tenant
627627
End if
628628

629-
$bearer:=$jwt.generate($options; This.privateKey)
629+
$bearer:=$jwt.generate($options)
630630

631631
$params.addQueryParameter("grant_type"; cs.Tools.me.urlEncode(This.grantType))
632632
$params.addQueryParameter("assertion"; $bearer)
@@ -643,7 +643,7 @@ Function _getToken_Service() : Object
643643
$options.payload.exp:=$options.payload.iat+3600
644644
$options.payload.sub:=This.clientId // Same as iss
645645

646-
$bearer:=$jwt.generate($options; This.privateKey)
646+
$bearer:=$jwt.generate($options)
647647

648648
// See documentation of https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-client-creds-grant-flow#second-case-access-token-request-with-a-certificate
649649
$params.addQueryParameter("grant_type"; This.grantType)

0 commit comments

Comments
 (0)