@@ -118,7 +118,7 @@ export interface AuthClientOptions {
118
118
domain : string ;
119
119
clientId : string ;
120
120
clientSecret ?: string ;
121
- clientAssertionSigningKey ?: string | CryptoKey ;
121
+ clientAssertionSigningKey ?: string | jose . CryptoKey ;
122
122
clientAssertionSigningAlg ?: string ;
123
123
authorizationParameters ?: AuthorizationParameters ;
124
124
pushedAuthorizationRequests ?: boolean ;
@@ -156,7 +156,7 @@ export class AuthClient {
156
156
157
157
private clientMetadata : oauth . Client ;
158
158
private clientSecret ?: string ;
159
- private clientAssertionSigningKey ?: string | CryptoKey ;
159
+ private clientAssertionSigningKey ?: string | jose . CryptoKey ;
160
160
private clientAssertionSigningAlg : string ;
161
161
private domain : string ;
162
162
private authorizationParameters : AuthorizationParameters ;
@@ -1079,19 +1079,18 @@ export class AuthClient {
1079
1079
) ;
1080
1080
}
1081
1081
1082
- let clientPrivateKey = this . clientAssertionSigningKey as
1083
- | CryptoKey
1084
- | undefined ;
1082
+ let clientPrivateKey : jose . CryptoKey | undefined = this
1083
+ . clientAssertionSigningKey as jose . CryptoKey | undefined ;
1085
1084
1086
- if ( clientPrivateKey && ! ( clientPrivateKey instanceof CryptoKey ) ) {
1085
+ if ( clientPrivateKey && typeof clientPrivateKey === "string" ) {
1087
1086
clientPrivateKey = await jose . importPKCS8 (
1088
1087
clientPrivateKey ,
1089
1088
this . clientAssertionSigningAlg
1090
1089
) ;
1091
1090
}
1092
1091
1093
1092
return clientPrivateKey
1094
- ? oauth . PrivateKeyJwt ( clientPrivateKey )
1093
+ ? oauth . PrivateKeyJwt ( clientPrivateKey as CryptoKey )
1095
1094
: oauth . ClientSecretPost ( this . clientSecret ! ) ;
1096
1095
}
1097
1096
0 commit comments